jQWidgets Forums

jQuery UI Widgets Forums Plugins Data Adapter Bug in jqxData

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Bug in jqxData #67106

    Fire613
    Participant

    I am writing to report a bug… I believe jqxData is to blame, but it might be in jqxcore. Sorry if this is already known… And I’m sorry but I cannot reveal my code and I don’t have time to create a jsfiddle, but a quick glance at the code base and you will see it is obvious.

    1. See the jqxGrid “columns” definition below
    2. optionsDataAdapter is set to bind to JSON via URL
    3. when a row is edited, dropdownlist will be created correctly but FIRES THREE AJAX REQUESTS
    4. if I switch the order of the properties being sent to jqxDropDownList, only ONE request is sent!! Yes, the order matters.

    There is a jQuery $.each() being used to iterate across the properties, but there is no check to make sure that the “source” property is processed last. So when the “displayMember” is changed, it fires an event that reloads the data, sending an additional request. Same goes for “valueMember”. So that makes THREE requests total.

    The workaround is obvious — just make sure the “source” property comes AFTER the “displayMember” and “valueMember” properties. But this is certainly NOT intuitive. The config object should be processed correctly.

    ver: 3.7.0

    
    columns: [
        {
            text: 'Sample Column',
            datafield: 'sample_id',
            displayfield: 'sample_label',
            columntype: 'dropdownlist',
            createeditor: function (row, cellvalue, $editor, celltext, cellwidth, cellheight)
            {
                $editor.jqxDropDownList({
                    source: optionsDataAdapter,    // if "source" comes before "displayMember" or "valueMember", multiple req's will be sent
                    displayMember: 'name',
                    valueMember: 'id',
                    dropDownWidth: 200
                });
    
            }
        }
    ]
    
    Bug in jqxData #67153

    Peter Stoev
    Keymaster

    Hi Fire613,

    There is no bug here. In your code, you override the DropDownList editor and you dynamically set multiple properties which all affect its Data Source which of course requires rebinding.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.