This topic contains 2 replies, has 2 voices, and was last updated by 4xjbh 8 years, 9 months ago.
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
jQuery UI Widgets › Forums › Lists › ComboBox › Setting Combobox Value
Tagged: bootstrap, combobox, javascript combobox, jQuery, jquery combobox, jqwidgets, jqwidgets combobox
This topic contains 2 replies, has 2 voices, and was last updated by 4xjbh 8 years, 9 months ago.
I have a combobox configured and it appears to be working correctly but when I try to set the value with $(“#company_id”).val( 46 ); it does not set. My source has a record with the id of ’46’.
Other inputs, checkboxes, radio buttons are not a problem with .val(). Using (‘val’, ‘New Value’) does not work either. What could be stopping this from working.
{“46″:”Ankunding-Reinger”,”19″:”Balistreri LLC”,”7″:”Bergnaum, Towne and Ryan”,”47″:”Bernhard PLC”,”22″:”Bode Group”}
http://jsfiddle.net/jqwidgets/efNXk/
/* Company Select Box */
var companylist =
{
datatype: "json",
datafields: [
{ name: 'id' },
{ name: 'name' }
],
url: "../../company/companylist",
};
var data_companylist = new $.jqx.dataAdapter(companylist);
$("#company_id").jqxComboBox(
{
source: data_companylist,
placeHolder: "Select a Company . . . ",
displayMember: "name",
valueMember: "id",
height: inputHeight
});
Hi 4xjbh,
As far as I see, you don’t have name and id members in that JSON. Do you even see any data in the ComboBox with that binding?
Best Regards,
Peter Stoev
jQWidgets Team
http://www.jqwidgets.com
Yes there was combobox data with the binding. But you were correct, the lack of the attribute–value pair labels was the problem.
You must be logged in to reply to this topic.