$('#dg').datagrid({ loadFilter:function(data){ if (!data){ return {"total":0,"rows":[]}; } else { //return other data } }});