jQuery UI Widgets Forums Plugins Data Adapter Problem with filterbox.records

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 7 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Problem with filterbox.records #24967


    // updates the listbox with unique records depending on the selected column.
    var updateFilterBox = function (datafield) {
    var filterBoxAdapter = new $.jqx.dataAdapter(source);
    var uniqueRecords = filterBoxAdapter.records;
    filterBoxAdapter.splice(0, 0, ‘(Select All)’);
    $(“#filterbox”).jqxListBox({ source: uniqueRecords, displayMember: datafield });

    I have this code that I took from one of your samples and all of my source data comes from a json string originally, but it was already properly converted and displaying in my grid. However, filterBoxAdapter.records does not populate my list and when I call filterBoxAdapter.records.length, it returns 0. meaning there is nothing there. The list gets populated if I use filterBoxAdapter without the records, but then nothing else works and i get errors because it is not an array. Help?

    Problem with filterbox.records #24970

    Peter Stoev


    If you populate it from remote source i.e you set the “url” property and the source object’s async is not set to false, you should expect that records.length will be 0, because the dataAdapter will still not be filled with data. If you want to be sure that it is filled with data, then use the dataAdapter’s loadComplete callback function.

    Best Regards,
    Peter Stoev

    jQWidgets Team

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.