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
380
Changing selected row programatically does not fire rowSelectionChanged event?
posted

We're using an igGrid (currently v12.1) applied to a <table id="dropDown"> element inside a <div> as the drop-down for a custom comboBox:

$("#dropDown").igGrid({
                autoGenerateColumns: false,
                dataSource: myDataSource,
                primaryKey: myPrimaryKey,
                columns: myColumnHeaderInfo, // This has some hidden columns
                width: "100%",
                height: "100%",
                autofitLastColumn: true,
                autoFormat: true,
                caption: "Drop-down Caption",
                tabIndex: -1,
                features: [
                    {
                        name: 'Selection',
                        mode: "row",
                        rowSelectionChanged: gridMainTable_RowSelectionChanged
                    }
                    , {
                        name: "Sorting",
                        type: "local"
                    }
                    , {
                        name: 'Resizing'
                    }
                ]
            });

 During the keyDown event on an <input>, pressing the "down" key (keyCode = 40) increments the selected row index:

var row = $("#dropDown").data("igGrid").selectedRow();
$("#dropDown").igGridSelection("selectRow", row.index + 1);

This selects the proper row, but does not fire the rowSelectionChanged event (handled by gridMainTable_RowSelectionChanged).

Are we doing something wrong or is this behavior as-designed?  Is there a better way to do this?

Parents
No Data
Reply
  • 23953
    Verified Answer
    Offline posted

    Hi,

    Ignite UI API methods do not rise events by design. You should manually execute the code in the event, when you call an API method.

    Best regards,
    Martin Pavlov
    Infragistics, Inc.

Children