jQWidgets Forums
jQuery UI Widgets › Forums › Lists › ComboBox › Combobox list categories.
This topic contains 4 replies, has 2 voices, and was last updated by PiDome 11 years, 2 months ago.
-
Author
-
Hi all,
I have seen that list categories are possible. For me it is not possible to use the keyword ‘group’ inside json data as shown in the example.
I’m using the data adapter to retrieve a list of json values which looks like below:
{ "jsonrpc": "2.0", "id": "LocationService.getLocations", "result": { "message": "", "data": [ { "id": 1, "floorname": "Unknown", "floor": 1, "name": "Unknown", "fixed": true }, { "id": 2, "floorname": "Main floor", "floor": 2, "name": "Power cabinet", "fixed": false } ], "success": true } }
I would like to group the list based on “floorname”.
I have tried to use the ‘group’ parameter in the data adapter without result. Is there a a combobox parameter i’m overlooking defining the field i can use as a group?
Thanks in advance,
John.Hi John,
Possible solution would be to load your data through data adapter, then prepare an Array with “group”, “label” and “value” parameters set for each item in the way you prefer, then pass the Array to the jqxComboBox’s source property.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
The page where this is used also has the possibility to edit these values after successful editing i call dataBind(); to refresh the source list. This list is used in multiple comboboxes throughout the page.
Can i cross bind those arrays retrieved and prepared?
Best regards,
John.Hi John,
I do not know the specifics of your application, but I suppose that you can reuse prepared Arrays.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
Maybe the next screenshot makes it clearer: http://pidome.wordpress.com/screenshots/web-screenshots/newlocationeditor/
When a user adds or edits a floor, all the floor comboboxes are refreshed with the data adapter. The floor edits also triggers a other data adapter for the locations combobox which are childs of the floors.
On the bottom of the page there is Edit/Delete locations header where the locations dropdown resides and over there i would like to use the categories function with the JSON result as shown above in the first post. There i would like to use the floorname as category.
So the question is as follows:
Can i use a dataBind function for the locations data adapter which: First, as works, retrieve the original JSON result, put it in an array wich it prepares the array with “group”, “value” and “label” fields and finally automatically updates the combobox with the prepared array?Best regards,
John. -
AuthorPosts
You must be logged in to reply to this topic.