⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Saving data does not reset the SELECT drop downs, but that chosen option is then not saved on subsequent saves



amityweb

amityweb
  • profile picture
  • Member

Posted 06 February 2012 - 17:11 PM

Hope you understand the long title!

Basically if you have a select drop down of options, you choose some options, then click Save, the form is reset so all fields go blank ready for the next data entry, BUT the SELECT drop down fields do NOT reset, so the previous data is chosen.

The problem is, if you want to keep this chosen SELECT drop down, so it is the same value as previously, then you will not change it and just click Save. BUT this option is then not saved. So to save the SELECT drop down option you have to change its value before saving everytime.

So there are two options...

1) The SELECT drop down does save the value when you hit save a second time, OR

2) When the form resets the SELECT drop down is also reset forcing the user to choose an option again

Does anyone have any ideas how to fix this?

I was thinking of finding the Javascript that resets this field when you click the small x button next to the chosen option, and calling it after Save, but its all too complicated.

Thanks

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 06 February 2012 - 19:44 PM

With this post you actually find two BUGS.

The first one was from grocery CRUD that I add it as an issue and I fixed it immediately. You can see the FIX at: https://github.com/scoumbourdis/grocery-crud/commit/2f396dce34a04b50a541ca0f5e2449ad2bd8aa9d

And the second one was at the plugin that I also added as an issue ( https://github.com/harvesthq/chosen/issues/483 ) and I will update it to grocery CRUD as soon as the issue is fixed by the developer. It is just an interface really small issue, that doesn't really matters.

Thanks to mention it.

amityweb

amityweb
  • profile picture
  • Member

Posted 06 February 2012 - 20:30 PM

Ok thanks. I'm not so familiar with how git works yet so does it mean this fix will be in future releases, so should be ok to do this to the core code? I see lots of forks and things on git hub for grocerycrud but never know if it's safe to use them because I want my code to be easily updateable so no hacks.

Thanks

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 06 February 2012 - 21:09 PM

Actually you can see the network ( https://github.com/s...ry-crud/network ) and see if the forked project is pulled with the master. If it's not , then it will not released with grocery CRUD. This is not the best way to do it, because the "master" version is actually the trunk , so perhaps sometimes something don't work 100%. So for now the way I am programming is that the master WILL be released. So you have two options
1. You can just make the changes by your self if you see something at the master that you want to add it. ( for example the BUG fix #9 )
2. You can download ALL the project and copy all the files to your project by simply press the zip button at the attached image: [attachment=35:2012-02-06_210425.png] .
Just make sure, that I don't have any incomplete features.

For example now you can safely download all the project and copy the files to your project without any problem ( https://github.com/s.../zipball/master ). I also have
completed the date and date-time and the upload to work to all browsers.

Of course always make sure that you have a backup to your previous release just to have a rollback if something goes wrong (this has to be done in every update/release ).

amityweb

amityweb
  • profile picture
  • Member

Posted 07 February 2012 - 09:19 AM

I've downloaded the latest files from Github but the SELECT lists still do not clear when I save. Nor do the values that are selected save. So the problem still exists. I checked the files against the changes in Github and they seem to be the correct files.

amityweb

amityweb
  • profile picture
  • Member

Posted 07 February 2012 - 09:22 AM

Sorry they DO clear!!! Maybe my cache wasnt updated for the JS changes. But it IS clearing now so that problem is fixed!

Thanks very much

Yasser Moghrabiah

Yasser Moghrabiah
  • profile picture
  • Member

Posted 12 February 2012 - 07:00 AM

Thanks I had the same problem with drop down

but [color=#ff0000]there is also another bug[/color]:

file upload field doesn't clear also after insert

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 12 February 2012 - 12:10 PM

Yes you are right. Bug is now fixed. https://github.com/scoumbourdis/grocery-crud/commit/f4b6ba1e8ab26de22edd52e4a85f4c67ead0a50e .
Thank you Yasser

skeptikos

skeptikos
  • profile picture
  • Member

Posted 29 April 2016 - 13:15 PM

jQuery chosen select doesn't clear properly neither, according to what have been done in Bug fix #9 I added these lines in flexigrid-add.js and datatables-add.js :
 
// jquery chosen select and multiple select
$('.chosen-select, .chosen-multiple-select').each(function() {
    $(this).val('').trigger('chosen:updated');
});

lvrocha

lvrocha
  • profile picture
  • Member

Posted 22 May 2016 - 02:35 AM

 

jQuery chosen select doesn't clear properly neither, according to what have been done in Bug fix #9 I added these lines in flexigrid-add.js and datatables-add.js :
 
// jquery chosen select and multiple select
$('.chosen-select, .chosen-multiple-select').each(function() {
    $(this).val('').trigger('chosen:updated');
});

 

 

This is also valid for the bootstrap theme. I was with the same problem and added the above lines and it worked for me.


jonathan-paginas@hotmail.c

jonathan-paginas@hotmail.c
  • profile picture
  • Member

Posted 27 August 2018 - 02:26 AM

hello 

 

i have problem with select, this element not reset. v. grocery crud 1.6.1.
there is a method for solution it