$('#dg').datagrid({ onLoadSuccess: function(data){ if (data.rows.length){ $(this).datagrid('scrollTo', 0); } }})