Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
8920
igGrid with igCombo editor
posted

All described is in 13.2, it is still not expired, so please advise for this particular version

Setting : Grid that has one column with combo editor, both data sources for grid and combo editor are provided dynamically after initialization on the page load.  When data is loaded modal form with grid get opened by clicking button and at that point data sources got assigned and grid  get bind.  Here the snippets for data bind function and part of the relevant grid setting       

function bindMatchGrid() {

            if (pageController && $.isFunction(pageController.uoa)) {

                var uoaData = pageController.uoa(false);

                var uoaExtendedData = transformMatchData(uoaData);

                $('#uoaAuditGrid').igGrid('option', 'dataSourceType', 'json').igGrid('option', 'dataSource', uoaExtendedData).igGrid('dataBind');

                var editor = $('#uoaAuditGrid').igGridUpdating("editorForKey", "AuditName"); // this is just an unsuccessful attempt to obtain combo editor reference 

                var columnSettings = $('#uoaAuditGrid').igGridUpdating("option", "columnSettings");

                $.each(columnSettings, function () {

                    if (this.columnKey === "AuditName") {

                        this.editorOptions.dataSource = pageController.getAvailAudits()

                    }

                })

            }

        }

 

……………………………

{

                            columnKey: 'AuditName',

                            editorType: 'combo',

                            editorOptions: {

                                autoComplete: true,

                                //  dataSource: pageController.getAvailAudits(),

                                allowCustomValue: false,

                                textKey: 'AuditName',

                                valueKey: 'AuditName',

                                showDropDownButton: false,

                                enableClearButton: false,

                                dropDownOnFocus: true,

                                selectionChanged: function (evt, ui) {

                                    var name = ui.items[0].value;

                                    rowID = $("td.ui-iggrid-editingcell").parent().attr("data-id");

                                    var avail = pageController.getAvailAudits();

                                    var set2 = _.find(avail, function (aidit) { return aidit.AuditName == name; });

                                    _.each(pageController.uoa(false), function (uoas) {……….

………………………………………………………………………………………………………………..

 

All works well on the first opening of the form but when data get reload and bindMatchGrid() is called again grid binding works and fresh data is displayed on the grid, but the combo drop down still shows data the was loaded on original page load… if page get manually reload and sequentially data load again then new data set is shown, but if just new data fetched , than drop down not get updated despite the fact that correct data is put into data source on this lines :

                    if (this.columnKey === "AuditName") { 

                        this.editorOptions.dataSource = pageController.getAvailAudits()

                   }

I need the following and I can not find it in the documentation:

  1. How to obtain reference to the combo editor of the column with particular key :

I tried this while binding :   var editor = $('#uoaAuditGrid').igGridUpdating("editorForKey", "AuditName");

    It did return null.. if somehow I’ll get reference to combo editor I probably will be able to use this : $(".selector").igCombo("dataBind"); and it might resolve the issue

   2. Also if there is a way before binding starts to reinitialize grid, so it will be clear of any particular data, and then apply binding to the grid and provide data source for the combo.. that what it does now on first page load and it works. 

Thanks

Parents Reply Children