-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to save sort order of listbox #24
Comments
This belongs to the server side, see #15 |
No, not entirely. It was suggested creating a hidden field that holds a comma delimited string of the indexes sort order. I'd need to modify the bsmSelect script to update that hidden field unless I attach to the listbox's update event. Connie DeCinko, Programmer Analyst -----Original Message----- This belongs to the server side, see #15 Reply to this email directly or view it on GitHub: |
Yep but why would you store it client side, that is redundant information with the |
Problem as reported on the asp.net forum: The problem is that postback doesn't retain the order of list items. It will remember the selected item, but not the order. If you need to save it you'll have to iterate the items in script, then post that back directly from script. Or, iterate in script, concatenate into a string placed into a hidden field, then do a normal post back. In server code use the hidden field value to reconstruct the order. I'll take a look at the listen example. Connie DeCinko, Programmer Analyst -----Original Message----- Yep but why would you store it client side, that is redundant information with the Reply to this email directly or view it on GitHub: |
True, if you want to restore the order of unselected options, you might want to use your solution. Then I would suggest to serialize the order on the form submit event. |
You have convinced me, it seems to be a valid issue after all. |
Well... not so sure after all. Do you have an example where the sort ordre is not maintained (may be a link on asp.net) ? |
Here is the code that did not work for me. Items were saved, but not in the order shown in the browser:
Check the thread at http://forums.asp.net/t/1661881.aspx/1 for a discussion of the issue. Here is what I came up with for a solution. Feels ugly, but it works:
Connie DeCinko, Programmer Analyst -----Original Message----- Well... not so sure after all. Do you have an example where the sort ordre is not maintained (may be a link on asp.net) ? Reply to this email directly or view it on GitHub: |
Ok, is there any need for a generic solution as I have proposed earlier then ? |
I could see it if it's fairly easy to implement. This could be an issue with other platforms, not just .net. Connie DeCinko, Programmer Analyst -----Original Message----- Ok, is there any need for a generic solution as I have proposed earlier then ? Reply to this email directly or view it on GitHub: |
I'll give it a shot, should be easy. On 01/24/2012 04:57 PM, StateBarofArizona wrote:
|
Q: do you prefer to receive all the options or just the selected ones ? |
Sounds like you're on the right path. Connie DeCinko, Programmer Analyst -----Original Message----- I'll give it a shot, should be easy. On 01/24/2012 04:57 PM, StateBarofArizona wrote:
Reply to this email directly or view it on GitHub: |
For my use, I only need the selected ones. Connie DeCinko, Programmer Analyst -----Original Message----- Q: do you prefer to receive all the options or just the selected ones ? Reply to this email directly or view it on GitHub: |
May be the full list is better if you need to maintain a sorting order in a DB (i.e. with a unique constraint). Let me know, there is an implementation here: 9ddb468 |
Ah 'rel' is not allowed on inputs so the id as to be |
Hey guys i have some idea on it. what if we add I did it with regards |
I can reorder the items and they are also reordered in the listbox. However, it does not appear to be possible to store this sort order unless it's held in another hidden field. Can this feature be added or can you suggest how to implement such a feature?
The text was updated successfully, but these errors were encountered: