I’m having issues with Save/Load state functionality. The navGrid is not replaced when clicking the Load button. Any idea how to rebuild the navGrid when loading a saved state?
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
var $grid = $("#jqGridExplore"); $grid.jqGrid({ jsonReader: { repeatitems: false, root: "rows", page: "page", total: "total", records: "records", cell: "", id: "_id" }, url: "/projects/" + project + "/subjects/" + expedition, mtype: "GET", datatype: "json", page: 1, colNames: result.colNames, colModel: cm, rowNum: 10, rowList: [10, 20, 50, 100], multiSort: true, sortable: true, sortname: 'id', sortorder: 'asc', multiselect: true, multiboxonly: true, viewrecords: true, shrinkToFit: true, autowidth: true, height: '100%', pager: "#jqGridExplorePager", gridComplete: function () { updateUrlLinks.call(); updateOcrText.call(); }, onSelectRow: function (id, isSelected) { updateIdsOfSelectedRows(id, isSelected); }, onSelectAll: function (aRowids, isSelected) { var i, count, id; for (i = 0, count = aRowids.length; i < count; i++) { id = aRowids<em class="d4pbbc-italic"></em>; updateIdsOfSelectedRows(id, isSelected); } }, loadComplete: function () { var $this = $(this), i, count; for (i = 0, count = idsOfSelectedRows.length; i < count; i++) { $this.jqGrid('setSelection', idsOfSelectedRows<em class="d4pbbc-italic"></em>, false); } } }).navGrid("#jqGridExplorePager", { search: true, // show search button on the toolbar add: false, edit: false, del: false, refresh: true, closeOnEscape: true, closeAfterSearch: true, overlay: 0 }, {}, // edit options {}, // add options {}, // delete options { width: 600, multipleSearch: true, //multipleGroup: true, recreateFilter: true } // search options - define multiple search ).navButtonAdd('#jqGridExplorePager', { caption: '', buttonicon: "glyphicon glyphicon-list", title: "Choose columns", onClickButton: function () { $(this).jqGrid('columnChooser', { dialog_opts: { modal: true, width: 700, show: 'blind', hide: 'explode' }, done: function (perm) { if (perm) { this.jqGrid("remapColumns", perm, true); } } }); } }).navButtonAdd('#jqGridExplorePager', { caption: '', buttonicon: "glyphicon glyphicon-remove", title: "Clear saved grid's settings", onClickButton: function () { window.location.reload(); } }); |
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top