jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: specified values? specified values? #6865

    bitman0101
    Member

    I originally came here with the same question. I was able to populate my entries with labels and values using the link Peter Stoev posted above.

    As I am already doing standard jquery AJAX calls, I prefer to not have to include unnecessary libraries and would prefer to build the data structures myself.

    For anyone interested, this is how to build the format without an AJAX call via dataAdapter:

              $(document).ready(function () {
    // prepare the data
    myRows = [{RecordName: "test1", RecordID: 100}, {RecordName: "test2", RecordID: 200}];
    $("#dropdownlist").jqxDropDownList(
    {
    source: myRows,
    theme: 'classic',
    width: 200,
    height: 25,
    selectedIndex: 0,
    displayMember: 'RecordName',
    valueMember: 'RecordID'
    });
    var item = $("#dropdownlist").jqxDropDownList('getItem', 1 );
    var itemLabel = item["label"];
    var itemValue = item["value"];
    });
Viewing 1 post (of 1 total)