jQWidgets Forums
jQuery UI Widgets › Forums › Lists › ComboBox › API Documentation is incomplete for ComboBox addItem method …
Tagged: addItem, API, combobox, Documentation
This topic contains 7 replies, has 2 voices, and was last updated by mtbvfr 11 years, 12 months ago.
-
Author
-
Hi,
From looking around , there appears to be ways to add a “label – text to be displayed?” as well as a value but all the API Documentation has is the following.
————————————————————
Code exampleInvoke the addItem method.
// @param String
$(“#jqxComboBox”).jqxComboBox(‘addItem’, ‘jQuery’ );
————————————————————Can somebody please provide the full API Documentation with examples on the usage of each feature please?
Thank you, Michael.
Hi Michael,
The API Documentation is OK and the posted code shows how to Add an item to the ComboBox. We will keep improving it in the future, too. At present we do not have other documentation about the widgets.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
The posted code does not show how a “label – display text” should be added when adding an item to a ComboBox.
The API Documentation does not show what the parameters are for this.
For example if the Value is “1” and the Label to be displayed is “First Item”, where is the documentation that describes how this should be done?
Thank you, Michael.
Hi Michael,
The posted code shows how to add a new Item where the Label = “JQuery”. because the String value is considered to be a Label. We do not have documentation about adding an item with label and Value and I am not sure that this currently is possible, too. I will create a work item about that.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
If you look at the code of the examples (demos for jqxcombobox – bindingtojson.htm & bindingtoxml.htm), available in the download, you will see that when a ComboBox is being populated that both a Value and Label are being set for each row.
I also found the following post which is what prompted me to make my original post.
http://www.jqwidgets.com/community/topic/additem-problem/Where did dc4m get an example from for the following line of code?
$(‘#cbbCustomers’).jqxComboBox(‘addItem’, { value: “Create”, label: ‘Create “‘ + searchString + ‘”‘ });
Can the “item” Object, returned by using either the getItem or getItemByValue methods, be used to Set the values of the “label” or “value” as follows?
var objItem = $(“#jqxComboBox”).jqxComboBox(‘getItem’, 1 );
objItem.label = “Label Text”;Thank you, Michael
Hi Michael,
It is currently not possible to dynamically update an item in such way. I will create a work item about the missing functionality and I hope that we will be able to implement it for the next version.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
I guess the only other option, then, is that when a User enters text in the ComboBox, for which there is No Match, is to add it to the Local Storage and then reload/refresh the ComboBox list.
Is that feasible?
Thanks, Michael.
P.S.
Is the following line of code valid?
$(‘#cbbCustomers’).jqxComboBox(‘addItem’, { value: “Create”, label: ‘Create “‘ + searchString + ‘”‘ });
-
AuthorPosts
You must be logged in to reply to this topic.