Hello,
I never used a Jquery DropDownList in NSB, and I would like to know how to associate to each item listed in the “source” field a value like 0, 1 2,3 and so on.
Also, how the “onselect” event need to be written in NSBasic to obtain the selected item ?
I have tried reading the “.value” property without success.
jqWidgets has excellent documentation on their site. If you scroll down to Events, then click on select, you will see this:
Select
This event is triggered when the user selects an item.
Code example
Bind to the select event by type: jqxDropDownList.
$('#jqxDropDownList').on('select', function (event)
{
var args = event.args;
if (args) {
// index represents the item's index.
var index = args.index;
var item = args.item;
// get item's label and value.
var label = item.label;
var value = item.value;
var type = args.type; // keyboard, mouse or null depending on how the item was selected.
}
});
The item object has the following fields:
label - gets item’s label.
value - gets the item’s value.
disabled - gets whether the item is enabled/disabled.
checked - gets whether the item is checked/unchecked.
hasThreeStates - determines whether the item’s checkbox supports three states.
html - gets the item’s display html. This can be used instead of label.