Reputation: 99
Hi I was using EasyUI with my .Net API to do CRUD in table. I try to do the tutorial Build CRUD DataGrid with jQuery EasyUI but I build all script in js. Everything I work well the table show data I take form the API.
But when I add the editor in field for make the field can select and input data
$('#dgv').edatagrid({
url: '/Villa/GetVillas',
//saveUrl: '/Villa/CreateVilla',
//updateUrl: '/Villa/UpdateVilla',
//destroyUrl: '/Villa/DeleteVilla',
toolbar: [{
iconCls: 'icon-add',
text: 'Add',
handler: function () {
//$('#dgv').edatagrid('addRow');
}
}, '-', {
iconCls: 'icon-save',
text: 'Save',
handler: function () {
//$('#dgv').edatagrid('saveRow');
}
}, '-', {
iconCls: 'icon-remove',
text: 'Delete',
handler: function () {
//$('#dgv').edatagrid('destroyRow');
}
}, '-', {
iconCls: 'icon-cancel', // Custom "Cancel" button icon
text: 'Cancel', // Custom "Cancel" button text
handler: function () {
//('#dgv').edatagrid('cancelRow');
}
}],
columns: [[
{ field: 'name', title: 'Name', width: 200, editor:'text' },
{ field: 'occupancy', title: 'Occupancy', width: 100, editor:'numberbox' },
{ field: 'sqft', title: 'Sqft', width: 100, editor:'numberbox' }
]],
idField: "id",
rownumbers: true,
fitColumns: true,
singleSelect: true,
pagination: true
});
It cause error. When I dbclick a row to make it select to input then click other row it show error in console. It allway happen when I select other rows.
tooltip.js:729 Uncaught TypeError: No method named "destroy"
at HTMLInputElement.<anonymous> (tooltip.js:729:17)
at Function.each (jquery-3.7.1.min.js:2:3129)
at ce.fn.init.each (jquery-3.7.1.min.js:2:1594)
at ce.fn.init.jQueryInterface [as tooltip] (tooltip.js:724:17)
at _586 (jquery.easyui.min.js:7606:9)
at HTMLInputElement.<anonymous> (jquery.easyui.min.js:7820:1)
at Function.each (jquery-3.7.1.min.js:2:3129)
at ce.fn.init.each (jquery-3.7.1.min.js:2:1594)
at Object.destroy (jquery.easyui.min.js:7819:11)
at $.fn.validatebox (jquery.easyui.min.js:7798:38)
I was checking for this error may cause by the destroy properties in Editor. But in the demo CRUD datagrid it not cause this error. I do all step same with tutorial then how it have this error? Please let me know if you have solve the same problem. Thank you.
Upvotes: 0
Views: 120
Reputation: 1
In my case it happens because I invoked the "bootstrap.min.js" script that conflicts "edatagrid" script. So to solve it I detached the "bootstrap.min.js" script. And it worked for me.
Upvotes: 0