The following no longer works with v4.8.0…
|
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 |
$.extend($.jgrid.defaults, { url: 'handlers/dgPager.ashx', datatype: 'json', gridview: true, ignoreCase: true, loadui: 'disable', onInitGrid: function () { console.log('onInitGrid invoked'); var editurl = $(this).jqGrid('getGridParam', 'editurl') || ''; if ($(this).jqGrid('getGridParam', 'multiselect') == false) { $(this).jqGrid('bindKeys', { scrollingRows: true, onEnter: function (rowid) { if (editurl.length > 0) { $(this).jqGrid('editGridRow', rowid, $(this).data('editOptions')); } } }); } var url = $(this).jqGrid('getGridParam', 'url'); var loadonce = $(this).jqGrid('getGridParam', 'loadonce'); if (loadonce == true && url.toLowerCase().indexOf('dgpager.ashx') > -1) { $(this).jqGrid('setGridParam', { postData: { 'loadonce': true } }); } }, beforeRequest: function () { EnableUI(false); $('#' + $(this).prop('id') + '_err').remove(); }, loadComplete: function (data) { EnableUI(true); }, loadError: function (jqXHR, textStatus, errorThrown) { $('#' + this.id + '_err').remove(); $(this).closest('div.ui-jqgrid').before( $.validator.format(' <div id="{0}_err" style="max-width: {1};">' + ' <div class="ui-state-error ui-corner-all" style="padding: 0.5em; float: left; font-size: smaller;">{2}</div> ' + ' <div style="clear: left;"></div> </div> ', this.id, this.style.width, jqGridExtractErrorTitle(jqXHR.responseText)) ); $(this).triggerHandler('jqGridLoadError', [jqXHR, textStatus, errorThrown]); EnableUI(true); }, ondblClickRow: function (rowid) { var $this = $(this); if ($this.jqGrid('getGridParam', 'editurl') && $this.jqGrid('getGridParam', 'editurl').length > 0) { $this.jqGrid('resetSelection'); $this.jqGrid('setSelection', rowid, true); $('#gbox_' + $this.prop('id')).find('.ui-icon-pencil').click(); } } }); |
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top