This topic contains 1 reply, has 2 voices, and was last updated by Christopher 10 years ago.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
jQuery UI Widgets › Forums › Getting Started › how to change the text of jqxcombobox inside the grid status bar
Tagged: Angular combobox, bootstrap combobox, javascript combobox, jquery combobox, jqwidgets combobox, jqxcomboBox value change
This topic contains 1 reply, has 2 voices, and was last updated by Christopher 10 years ago.
Hi,
How can I change the text of jqxcombobox in its Status Bar?
renderstatusbar: function (statusbar) {
var combo = $(“<div style=’font-size: 12px; font-family: Verdana;float: left; margin-top: 1px; margin-left: 4px;’ id=’combocity’></div>”);
container.append(combo);
statusbar.append(container);
var source = new Array();
var city = ‘SLC’;
var cityid = ‘1’;
source[0] = { city: city, cityid: cityid };
var city = ‘LAX’;
var cityid = ‘2’;
source[1] = { city: city, cityid: cityid };
var dataAdapter = new $.jqx.dataAdapter(source, { async: false });
combo.jqxComboBox({selectedIndex: 0, source: dataAdapter, displayMember: “city”, valueMember: “cityid”, width: 65, height: 25});
}
$(“#changeCombo”).on(‘click’, function (event) {
document.getElementById(‘combocity’).value = ‘LAX’;
});
Hi takwaicheng,
If you just want to change the selection(the actual value) of the jqxComboBox, you can do that by calling the selectItem method of the widget. If you just want to change the visible label of the item in the ComboBox, then you need to create a new source with datafields: ‘label’ – the new text you want to see as an option and ‘value’ – the field that has the value. Here’s how to do that:
http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/grid-list-filter-with-key-value-column.htm?light
The demo shows how to do it with jqxDropDownList, but the same can be accomplished with a jqxComboBox.
In future please post your questions in the corresponding section of the forum( in this case, the jqxComboBox section).
Best Regards,
Christopher
jQWidgets Team
http://www.jqwidgets.com
You must be logged in to reply to this topic.