View Full Version : Paging ComboBox question (design)

4 May 2010, 6:26 PM
I'm using the paging Combo to set an id (int) with a fieldName (text). However, when the main page is loaded again after saving a selection, the store will not have the selected fieldName/id anymore. I could set the default search query in the pager to the fieldName to relocate the selection, but is there a better way todo this? design wise?

5 May 2010, 5:19 AM
This is really a implementation question. Creating the Paging ComboBox is easy, my problem is more of how to best render the current id/fieldName in the combo when the store doesn't have the current selection in memory.

I have a store with two fields "id, fieldName" with hundreds of db entries to look through. I use a Paging Combo to let them find the correct selection, select it and save their selection by id in the db.

Now when they change pages and return at some point, the store will NOT have the correct record loaded to display properly. I know there is a few ways to do this, but I want to find a clean way.

I've tried making sure the current selected record always returns to the store, but I don't like the extra junk I had to add on the server side.

I've tried using combo.setValue and combo.setRawValue in combination when the store loads with the correct fieldName/id pulled from the server, but it doesn't work well because I need the id Value to be an id and the rendered value to show the fieldName.

I understand that the Paging Combo is great for fields that don't need to retain their state (search bar), but I feel like I missing something.