Reputation: 3834
I have a datagrid (table) that when created, it sends two requests:
So the question is, what fires that request ?
onBeforeLoad:function(){return false;}
and still sends the unwanted request.HTML
<table
id="data-grid"
class="easyui-datagrid"
style="width:690px; height:660px"
url=""
title=""
rownumbers="false"
pagination="false"
singleSelect="true"
pageList="[10,20,30,1000]"
pageSize="1000"
>
<thead>
<tr>
</tr>
</thead>
</table>
JavaScript
$('#data-grid').datagrid({
//Lets add the parameters
queryParams: {
status_a: a),
status_b: b,
},
url: '/path/path',
columns:[[.....]],
});
Upvotes: 2
Views: 2509
Reputation: 3834
Here is the solution:
Remove class="easyui-datagrid"
from the HTML inside the <table></table>
definition.
When a element has 'class="easyui-datagrid"' attribute, it will be auto created as datagrid component. You don't need to create it again with javascript code. To prevent from making duplicate request to server, don't create datagrid more than once. If you wish to create datagrid in javascript, the simplest way is to remove 'class="easyui-datagrid"' from the element.
More information here: jeasy topic
Upvotes: 3