It is not the bug. You used the static data in the subgrid.
data:[
{orderdate:'08/23/2012',shippeddate:'12/25/2012',freight:9734}
]
This is why you get the same data when expanding different rows in parent datagrid. Please notice that you should set the 'foreignField' property in the subgrid. When expanding a row, the 'foreignField' parameter value will be post to server. You can return the different data back to browser according to this 'foreignField' value. The code below show how to achieve this feature.
var conf = {
options:{
fitColumns:true,
columns:[[
{field:'company',title:'Company Name',width:200},
{field:'contact',title:'Contact Name',width:200},
{field:'country',title:'Country',width:200}
]],
data:[
{companyid:'company1',company:'Speed Info',contact:'Minna John',country:'Sweden'}
]
},
subgrid:{
options:{
fitColumns:true,
foreignField:'companyid',
columns:[[
{field:'orderdate',title:'Order Date',width:200},
{field:'shippeddate',title:'Shipped Date',width:200},
{field:'freight',title:'Freight',width:200}
]],
// emulate the loading data from remote server
loader:function(param,success,error){
var companyid = param.companyid||'';
var row = {
orderdate:companyid+'-08/23/2012',
shippeddate:companyid+'-12/25/2012',
freight:parseInt(Math.random()*1000)
};
success([row]);
}
}
}
};
function append()
{
var r={companyid:'company2',company:'test', contact:'test', country:'country'};
$('#tt').datagrid('appendRow', r);
};