I have some problem here,
I want to make the datagrid collapsed if the datagrid rows is not empty..i can achieve it manually with this code below
$('#dg').datagrid({collapsed:true});
now i want to make it automatic collapsed, i try to put it on onLoadSuccess listener in datagrid so like the code below
onLoadSuccess:function(data){
if(data.total != 0){
$(this).datagrid({collapsed:true});
}
}
but what happen next is disaster,
the page / datagrid always reload everytime and never stopped and then the browser crashalready tried to use
$(this).datagrid('collapse');
$(this).panel('collapse');
but have no result
here the fiddle, change the
if(data.total == 0){ to
if(data.total != 0){ and press RUN button in top left . be carefull this will crash your browser
http://jsfiddle.net/aswzen/bgy4kg2k/3/any suggestion ?
thanks in advance