jQuery UI Widgets Forums Lists DropDownList jqxDropDownList lazy load

This topic contains 8 replies, has 4 voices, and was last updated by  Peter Stoev 9 years, 8 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • jqxDropDownList lazy load #64576

    AFraga
    Participant

    Hi, i would like to load the list, only when the user click to open it.

    I already try loading the source with the event

    widget.on(‘open’, function (event) {
    widget.jqxDropDownList({ source: dataAdapter });
    });

    And its working but! its not rendering all results! only one!

    Like this:

    [Filter^]
    [One result only]

    This is for the Grid filters! in order to load only distinct values from the server!

    Thanks.

    jqxDropDownList lazy load #64595

    Dimitar
    Participant

    Hello AFraga,

    In this case we recommend you set your filter options in the column property filteritems, which can be an Array or a data adapter instance. If you, however, do not wish to use this property for some reason, please provide us with a larger code sample so that we may determine if there is anything wrong with your solution.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    jqxDropDownList lazy load #64620

    AFraga
    Participant

    The problem using filteritems property is that the url is being hitted twice per column!

    And what i want is a “LAZY LOAD” or a “LATE LOAD”, that the dropdownlist get populated! only if the user open the filter!

    Imagine that I have a JQXGrid with thousand of rows, and 10 columns! its not good that the server is beeing hit 20 times! specialy
    if their are not going to filter any column!

    Thanks.

    jqxDropDownList lazy load #64622

    AFraga
    Participant

    Here is a small code that i think is working but render bad the dropdownlist

    Problem: My source bring arround 50 rows, the dropdownlist show only 5, without scrollbar.

    var source =
    {
        cache: false,
        datatype: "xml",//<rows><row mycolumn="Value" />...</rows>
        datafields: [
            {
                name: 'Label', map: function (obj) {
                    return $(obj).attr("MyColumn");
                },
            }
        ],
        root: "Rows",
        id: "ID",
        record: "Row",
        processData: function (data) {
            //Set which column i need to populate the unique values in the dropdownlist
            return data;
        },
        url: "../GetFilters.ashx"
    };
    var dataAdapter = new $.jqx.dataAdapter(source, { async: false });
    
    createfilterwidget : function (column, columnElement, widget) {
    
        widget.jqxDropDownList({
            displayMember: "Label",
            valueMember: "Label",
            width: '100%',
            checkboxes: true,
            dropDownWidth: 300,
            animationType : 'none'
        });
        widget.on('open', function (event) {
            widget.jqxDropDownList({ source: dataAdapter});
        });
    }
    jqxDropDownList lazy load #64643

    Peter Stoev
    Keymaster

    Hello AFraga,

    filteritems expects Array and nothing else. If array is passed, there is no URL.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    jqxDropDownList lazy load #64680

    AFraga
    Participant

    •filteritems – sets the items displayed in the list filter – when the “showfilterrow” property value is true and the filter’s type is “list” or “checkedlist”. The expected value is Array or jqxDataAdapter instance.

    I’m talking about the url of the jqxDataAdapter instance.

    jqxDropDownList lazy load #64694

    Peter Stoev
    Keymaster

    And I am telling you that if you want to display custom items in the filter widget you should use filteritems which accepts only Array.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    jqxDropDownList lazy load #66244

    Daniel H.
    Participant

    I don’t understand. He quoted the documentation exactly where it says “The expected value is Array or jqxDataAdapter instance.”

    Is the documentation incorrect?

    jqxDropDownList lazy load #66267

    Peter Stoev
    Keymaster

    Hi Daniel H.,

    There are samples and documentation which show how this works and show that it works. Example: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/grid-list-filter-with-key-value-column.htm?arctic. The user tries to create a custom filtering widget and implements createfilterwidget. There is absolutely no problem with filteritems.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.