Jump to content


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


  • Please log in to reply
10 replies to this topic

#1 amityweb

amityweb

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 06 February 2012 - 05: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

#2 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,096 posts
  • LocationLondon

Posted 06 February 2012 - 07: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/s...e2449ad2bd8aa9d

And the second one was at the plugin that I also added as an issue ( https://github.com/h...osen/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.
Posted Image

#3 amityweb

amityweb

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 06 February 2012 - 08: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

#4 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,096 posts
  • LocationLondon

Posted 06 February 2012 - 09: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: 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 ).
Posted Image

#5 amityweb

amityweb

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

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.

#6 amityweb

amityweb

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

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

#7 Yasser Moghrabiah

Yasser Moghrabiah

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 12 February 2012 - 07:00 AM

Thanks I had the same problem with drop down

but there is also another bug:

file upload field doesn't clear also after insert

#8 web-johnny

web-johnny

    grocery CRUD Author

  • Administrators
  • 1,096 posts
  • LocationLondon

Posted 12 February 2012 - 12:10 PM

Yes you are right. Bug is now fixed. https://github.com/s...85f4c67ead0a50e .
Thank you Yasser
Posted Image

#9 skeptikos

skeptikos

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 29 April 2016 - 01: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');
});


#10 lvrocha

lvrocha

    Newbie

  • Members
  • Pip
  • 1 posts

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.



#11 jonathan-paginas@hotmail.c

jonathan-paginas@hotmail.c

    Newbie

  • Members
  • Pip
  • 1 posts

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users