Итак, я пытаюсь обновить jquery на сайте, над которым я работаю, с 1.4 до 3.3, и у меня возникают проблемы с моим jqgrid. У меня есть HTML-таблица, которую я преобразую в jqgrid с помощью функции tableToGrid, и все в порядке, пока я не попытаюсь добавить filterToolbar.
Я также использую jqGrid 5.3.1. Вот фрагмент кода
<table id='warrantytable' class='tableinquiry' >
<thead>
<tr>
<th>Item<br/>Number</th>
<th>Order<br/>Number</th>
<th>WH Status</th>
<th>Kit SKU</th>
<th>Purchase<br/>Source</th>
<th>Store</th>
<th>Effective<br/>Date</th>
<th>Production<br/>Code</th>
<th>Factory<br/>Code</th>
<th>Smart<br/>Serial Number</th>
<th>Actual<br/>Serial Number</th>
<th>Serial<br/>Date</th>
<th>Serial<br/>Factory Code</th>
<th>Registration<br/>Date</th>
<th>User ID</th>
<th>Expiration<br/>Date</th>
<th>Warranty<br/>Item</th>
<th>Warranty<br/>Type</th>
<th>Warranty<br/>Duration</th>
<th>Edit</th>
<th>Info</th>
</tr>
</thead>
<tbody>
<tr class='highlight'>
<td align='center'>S3101</td>
<td align='center'>10000601-00</td>
<td align='center'>Open Order</td>
<td align='center'></td>
<td align='center'>F156</td>
<td align='center'></td>
<td align='center'>08/29/18</td>
<td align='center'></td>
<td align='center'></td>
<td align='center'></td>
<td align='center'></td>
<td align='center'></td>
<td align='center'></td>
<td align='center'>08/29/18</td>
<td align='center'>sheldoN@fdm4.com</td>
<td align='center'>03/05/20</td>
<td align='center'></td>
<td align='center'>Make-it-right</td>
<td>554</td>
<td><a onclick="javascript:_lastwarrantyrow = $('#warrantytable').jqGrid ('getGridParam', 'selrow'); warrantyUpdate('','','no');"> <img class='imgstyle' title='Edit warranty' width='16px' height='16px' /></a></td>
<td></td>
</tr>
</tbody>
</table>
<script>
tableToGrid('#warrantytable',{autowidth: true, forcefit: true });
$('#warrantytable').each(function(){$('#warrantytable').jqGrid('setColProp','Edit',{search: false});
$('#warrantytable').jqGrid('setColProp','Edit',{sortable: false});
$('#warrantytable').jqGrid('setColProp','Info',{search: false});
$('#warrantytable').jqGrid('setColProp','Info',{sortable: false});
$('#warrantytable').jqGrid('setColProp','ItemNumber',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','OrderNumber',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','WH_Status',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','Kit_SKU',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','PurchaseSource',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','Store',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','ProductionCode',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','FactoryCode',{searchoptions: {attr: {maxlength: 2}, clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','SmartSerialNumber',{searchoptions: {attr: {maxlength: 12}, clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','ActualSerialNumber',{searchoptions: {attr: {maxlength: 16}, clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','SerialDate',{searchoptions: {attr: {maxlength: 10}, clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','SerialFactoryCode',{searchoptions: {attr: {maxlength: 2}, clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','User_ID',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','ExpirationDate',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','WarrantyItem',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','WarrantyType',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','WarrantyDuration',{searchoptions: {clearSearch: false}});
$('#warrantytable').jqGrid('setColProp','EffectiveDate',{search: true, searchoptions: { sopt: ['eq'],dataInit: function (elem) { $(elem).datepicker({ dateFormat: 'mm/dd/y',changeYear:true,onSelect:function(){if(this.id.substr(0,3) === 'gs_'){setTimeout(function(){$('#warrantytable')[0].triggerToolbar();},50);}else{$(this).trigger('change');}} }) } }});
$('#warrantytable').jqGrid('setColProp','RegistrationDate',{search: true, searchoptions: { sopt: ['eq'],dataInit: function (elem) { $(elem).datepicker({dateFormat: 'mm/dd/y',changeYear:true,onSelect:function(){if(this.id.substr(0,3) === 'gs_'){setTimeout(function(){$('#warrantytable')[0].triggerToolbar();},50);}else{$(this).trigger('change');}} }) } }});;});
<!-- this is the error line -->
$("#warrantytable").filterToolbar({searchOperators : true});
if(_lastwarrantyrow != 0){$('#warrantytable').setSelection(_lastwarrantyrow,false);}
$(window).bind('resize', function() {$('#warrantytable').setGridWidth($(window).width() * 0.98);}).trigger('resize');
$(window).bind('resize', function() {winHeight = $(window).height();wHeight = winHeight - (winHeight * 0.5);if(wHeight < 125){wHeight = 125;}$('#warrantytable').jqGrid('setGridHeight',wHeight); }).trigger('resize');
</script>
Моя сетка все еще отображается, сортировка / определение размера / и т. Д. Работает, она просто не отображает панель инструментов фильтра