javascript - jqGrid inline navigator not initializing -
i'm trying initialize inline navigator on jqgrid. using version 4.4.0. code:
$('#line-items-grid').jqgrid({ caption : '', width : 704, shrinktofit : 1, forcefit : true, scrolloffset : 0, url : '', datatype : 'local', rownum : 20, viewrecords : true, height : 'auto', gridview : true, autoencode : true, pager : '#line-items-pager', colmodel : [ {label: 'commodity', name: 'contract_material', sortable: false, width: 99, cellattr: word_wrap, editable: true, classes: 'line-item-contract-material', edittype: "select"}, {label: 'date', name: 'date', sortable: false, width: 77, cellattr: word_wrap, editable: true, classes: 'line-item-date', editoptions: { datainit: function (el) { $(el).datepicker(); } }}, {label: 'vendor', name: 'vendor', sortable: false, width: 95, cellattr: word_wrap, editable: true, classes: 'line-item-vendor', editoptions: {maxlength: "50"}}, {label: 'ticket/po#', name: 'ticket_po_num', sortable: false, width: 66, cellattr: word_wrap, editable: true, classes: 'line-item-ticket-po-num', editoptions: {maxlength: "50"}}, {label: 'lbs', name: 'lbs', sortable: false, width: 73, cellattr: word_wrap, editable: true, classes: 'line-item-lbs'}, {label: 'units', name: 'units', sortable: false, width: 49, cellattr: word_wrap, editable: true, classes: 'line-item-units'}, {label: 'rate/ton', name: 'rate_per_ton', sortable: false, width: 64, cellattr: word_wrap, editable: true, classes: 'line-item-rate-per-ton'}, {label: 'rate/unit', name: 'rate_per_unit', sortable: false, width: 64, cellattr: word_wrap, editable: true, classes: 'line-item-rate-per-unit'}, {label: 'total', name: 'total', sortable: false, width: 72, cellattr: word_wrap, editable: true, classes: 'line-item-total'} ], jsonreader : { repeatitems: false }, onselectrow : function (id) { if (id && id !== lastsel) { $('#line-items-grid').jqgrid('restorerow', lastsel); $('#line-items-grid').jqgrid('editrow', id, { keys: true, extraparam: { reporting_period_id: function () { return $('#reporting_period_filter').val(); }, pickup_id: function () { return $('#pickup_filter').val(); }, lbs_per_ton: function () { return material_lbs_per_ton[$('#line-items-grid tr#' + id).find('td.line-item-contract-material select').val()]; } }, oneditfunc: lineitemeditprep, aftersavefunc: lineitemsuccess, errorfunc: lineitemerror, afterrestorefunc: function () { $('.qtip').qtip('destroy'); }, restoreaftererror: false }); //clear out error messages $('.qtip').qtip('destroy'); lastsel = id; } }, gridcomplete : lineitemviewprep, editurl : "line_items/line_item_edit" }); $('#line-items-grid').jqgrid('navgrid', '#line-items-pager', { add: false, edit: false, del: false }); $('#line-items-grid').jqgrid('inlinenav', '#line-items-pager');
i buttons regular navigator (view , refresh) showing up, no buttons inline navigator. missing?
(side note, if it's relevant: i'm setting url , datatype options on separate function loads data grid.)
i recommend use last version of jqgrid. it's version 4.4.5. between jqgrid 4.4.0 , 4.4.5 many bugs fixed.
the problem describe fixed in jqgrid 4.4.1. if require use old 4.4.0 should fix the line inside of navbuttonadd
method (it has line number 8796 in jquery.jqgrid.src.js
)
if( p.id && $("#"+$.jgrid.jqid(p.id), findnav).html() !== null ) {return;}
to line
if( p.id && $("#"+$.jgrid.jqid(p.id), findnav)[0] !== undefined ) {return;}
compare result of your original demo the same code used described above fix.
Comments
Post a Comment