| promise.done(function (e) { var Obj = $("#ResourcesGrid").ejGrid("instance"); // get instance of the existing grid Obj.model.columns = []; // remove the columns Obj.model.dataSource = ej.parseJSON(e.result.result); // udpate the dataSource var model = Obj.model; $("#ResourcesGrid").ejGrid("destroy"); // destroy the existing Grid $("#ResourcesGrid").ejGrid(model); // re render the Grid with new dataSource and old models. }); |
| |
| <script type="text/javascript"> var flag; function dataBound() { this.hideColumns("Id"); } $(function() { $("input[type=radio][name=resources]").change(function () { //var grid = $("#ResourcesGrid").ejGrid("instance"); var grid = $(".e-grid").ejGrid("instance"); grid.commonQuery = ej.Query().addParams("resourceTypeId", this.id); grid.refreshContent(); flag = 0; setTimeout(function () { if (flag == "0") { var Obj = $("#ResourcesGrid").ejGrid("instance"); // get instance of the existing grid Obj.model.columns = []; // remove the columns var model = Obj.model; $("#ResourcesGrid").ejGrid("destroy"); // destroy the existing Grid $("#ResourcesGrid").ejGrid(model); // re render the Grid with new dataSource and old models. var grid = $(".e-grid").ejGrid("instance"); grid.refreshContent(); flag = 2; } },100) }); }); </script> |