1. Problem description: When using easyui1.5, I found that if toolbar is used in datagrid, the paging control in datagrid will not display properly! Go down a few px, as shown in the picture:
2. Findings after debugging (2 points):
1. There are 2 implementation methods for the datagrid toolbar.
Not both implementations have the above problems. Only when using the
<code> <script> $(function(){ $('#category').datagrid({ url: '{:U("Category/getList")}', border: false, toolbar: '#tbar', fit: true, columns:[[ {field:'id',checkbox:true}, {field:'sort',title:'排序',width:100}, {field:'name',title:'栏目名称',width:100}, {field:'create_time',title:'创建时间',width:100}, ]], pagination: true, fitColumns: true, rownumbers: true, data: [ { "id": 1, "sort": 1, "name": "助力海东", "create_time": "2016-08-15 15:13:87" }, { "id": 2, "sort": 2, "name": "助力海东", "create_time": "2016-08-15 15:13:87" } ] }); }); </script> <table id="category"></table> <div id="tbar" style="padding: 5px;"> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</a> </div> </code>
Reply content:
2. Findings after debugging (2 points):
1. There are 2 implementation methods for the datagrid toolbar.
Not both implementations have the above problems. Only when using the
<code> <script> $(function(){ $('#category').datagrid({ url: '{:U("Category/getList")}', border: false, toolbar: '#tbar', fit: true, columns:[[ {field:'id',checkbox:true}, {field:'sort',title:'排序',width:100}, {field:'name',title:'栏目名称',width:100}, {field:'create_time',title:'创建时间',width:100}, ]], pagination: true, fitColumns: true, rownumbers: true, data: [ { "id": 1, "sort": 1, "name": "助力海东", "create_time": "2016-08-15 15:13:87" }, { "id": 2, "sort": 2, "name": "助力海东", "create_time": "2016-08-15 15:13:87" } ] }); }); </script> <table id="category"></table> <div id="tbar" style="padding: 5px;"> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</a> </div> </code>
Please help me if you have the same problem, thank you
1. Just use js array to write it, and there will be no problem.2. I have encountered many situations where the first time it was abnormal and the window would display normally just by changing the window, I guess the reason is this: easyui will get the height of the form for the first time, and then render the page, but you write the toolbar below Later, he thought that without that height, the paging would naturally go down a part when the toolbar is displayed. You can try adding the height attribute
<code> height : $('#**').height()-**, pagination : true, </code>