jQuery UI Widgets Forums Grid createeditor source call x-times

This topic contains 5 replies, has 2 voices, and was last updated by  Dimitar 10 years ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • createeditor source call x-times #63202

    simcon94
    Participant

    Hi,
    i have a Grid with a jqxDropDownList in createeditor:
    When i click in this cell, it call more than one time the dataadapter…

    Grid

    
    $("#grid").jqxGrid(
                    {
                        width: sk.appHelper.getMaxContentWidth()
                        , height: sk.appHelper.getMaxGridHeight()
                        , source: dataAdapter
                        , editable: editable
                        , editmode: 'dblclick'
                        , columnsresize: true
                        , columnsreorder: true
                        , groupable: true
                        , sortable: true
                        , filterable: false
                        , columns: [
                            { text: '@Resources.Tariff.Name', datafield: "Name", width: '20%' }
                            , { text: '@Resources.Tariff.TimeFrom', datafield: "TimeFrom", cellsformat: 'HH:mm:ss', columngroup: '@Resources.Tariff.Time', width: '20%' }
                            , { text: '@Resources.Tariff.TimeTill', datafield: "TimeTill", cellsformat: 'HH:mm:ss', columngroup: '@Resources.Tariff.Time', width: '20%' }
                            , {
                                text: '@Resources.Tariff.Day', columntype: 'dropdownlist', datafield: 'Day', width: '10%',
                                createeditor: function (row, column, editor) {
                                    // assign a new data source to the dropdownlist.
                                    var days = [
                                        { value: "0", label: '@Resources.Global.Monday' }
                                        , { value: "1", label: '@Resources.Global.Tuesday' }
                                        , { value: "2", label: '@Resources.Global.Wednesday' }
                                        , { value: "3", label: '@Resources.Global.Thursday' }
                                        , { value: "4", label: '@Resources.Global.Friday' }
                                        , { value: "5", label: '@Resources.Global.Saturday' }
                                        , { value: "6", label: '@Resources.Global.Sunday' }
                                    ];
                                    editor.jqxDropDownList({ autoDropDownHeight: true, source: days, displayMember: 'label', valueMember: 'value' });
                                }
                            }
                            , { text: '@Resources.Tariff.Price', datafield: "Price", columngroup: '@Resources.Tariff.Time', width: '10%' }
                            , {
                                text: '@Resources.Tariff.Currency', columntype: 'dropdownlist', displayfield: "Currency", datafield: "CurrencyId", filtertype: 'checkedlist', width: '10%', 
                                createeditor: function (row, cellvalue, editor) {
                                    editor.jqxDropDownList({ source: dataAdapterCurrency, displayMember: 'Symbol', valueMember: 'Id', placeHolder: "Bitte wählen", dropDownHeight: 75 });
                                },
                            }, { text: "Id ", datafield: "Id", width: 1, hidden: true }
    
                        ]
                    });

    DataApapter

    
     // Datasource for Currency
            var sourceDropDownCurrency =
            {
                datatype: "json",
                datafields: [
                    { name: 'Id', type: 'string' }
                    , { name: 'Symbol', type: 'string' }
                ],
                // get Model Data
                url: sk.appHelper.getAppDomainAppVirtualPath() + "/Tariff/GetCurrency"
            };
            var dataAdapterCurrency = new $.jqx.dataAdapter(sourceDropDownCurrency);
    
    createeditor source call x-times #63219

    Dimitar
    Participant

    Hello simcon94,

    A similar situation is discussed in the following forum topic: http://www.jqwidgets.com/community/topic/using-dropdownlist-in-grid-call-datasource-3-times/. If it does not help you resolve your issue, please provide us with a JSFiddle example we can test to determine if there is anything wrong with your implementation.

    Best Regards,
    Dimitar

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

    createeditor source call x-times #63263

    simcon94
    Participant

    Not really,
    in this example was autobind: true
    But in my code, i dont have autobind…..

    createeditor source call x-times #63266

    Dimitar
    Participant

    Hi simcon94,

    Then please provide us with a JSFiddle example we can test to determine if there is anything wrong with your implementation.

    Best Regards,
    Dimitar

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

    createeditor source call x-times #63282

    simcon94
    Participant

    sorry, it cant do it in fiddle

    createeditor source call x-times #63336

    Dimitar
    Participant

    Hi simcon94,

    Unfortunately, without a sample to test, we cannot assist you. Please review your code and check for any lines where you re-bind the data adapter.

    Best Regards,
    Dimitar

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

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

You must be logged in to reply to this topic.