Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

When is a Grid Object Ready to Use

$
0
0

I am using the setOptions method of the Kendo UI Grid to persist user options for columns, sorting, etc.  I am storing the options in local storage of the browser. 

I need to call setOptions when the view is displayed and the Grid has been created.  It's a bit inconsistent, as sometimes when the grid.setOptions() is called, the grid object is undefined.  How can I make sure that I don't call grid.setOptions until the grid is ready to use?  Code snippet shown below.

$("#grid").kendoGrid({

});

var grid = $(_gridId).data("kendoGrid");
var options = localStorage['xxxx'];
if (options) {
grid.setOptions(JSON.parse(options));
}


Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>