EasyUI Forum

General Category => Bug Report => Topic started by: mzeddd on June 12, 2013, 03:33:05 AM



Title: all lines in datagrid gets selected after content reload
Post by: mzeddd on June 12, 2013, 03:33:05 AM
If I have no selected lines in my datagrid and call reload I have no problems

But once I select line and call reload of this datagrid then I have all loaded lines selected

It is visible with 1.3.3 (with 1.3.2 I had no problems like this) in Firefox and in Opera.


Title: Re: all lines in datagrid gets selected after content reload
Post by: stworthy on June 12, 2013, 05:21:28 AM
Here is the datagrid example http://www.jeasyui.com/demo/main/index.php?plugin=Application&theme=default&dir=ltr&pitem=Basic%20CRUD. It has no problem you pointed out.

Please provide an example to demonstrate your issue.


Title: Re: all lines in datagrid gets selected after content reload
Post by: mzeddd on June 13, 2013, 04:36:50 AM
Hi,

I have found the reason of this problem.
This is how I had in my file:

Code:
<script>
$(function(){
$('#dg').datagrid({
title:'dg',
animate:false,
url:'../datagrid/datagrid_data1.json',
singleSelect:true,
idField:'id',
columns:[[
{field:'itemid',title:'itemid',width:100},
{field:'productid',title:'productid',width:150}
]]
});
});
function test(){
$('#dg').datagrid('reload');
}
</script>

idField:'id' has to be idField:'itemid'