Wednesday, September 24, 2014

Kendo UI Grid: manipulate the loaded grid rows

How To detect when the grid DOM is ready after a refresh? Or, alternatively, is there a way to detect as each TR element is created.

Actually, it can be done in dataBound as below:
(The code is trying to find from the td in the last column then filter it)
            dataBound: function () {
                var grid = this;
                grid.table.find("tr td:last-child").filter(function () { return $.text([this]) == $("#XXX").val(); }).closest('tr').addClass("k-state-selected");
                //save to history state
                var stateObj = { id: $("#XXX").val() };
                window.history.pushState(stateObj, null, null);
                return;
            }
            }

No comments:

Post a Comment