1. Set the 'data' property to load local data or 'url' property to load remote data.
$('#dg').datagrid({data:...}); // load local data
$('#dg').datagrid({url:...}); // load remote data
2. Call 'getData' or 'getRows' methods to return the data bound to datagrid.
var data = $('#dg').datagrid('getData');
console.log(data);
var rows = $('#dg').datagrid('getRows');
console.log(rows);
3. To upload a file, declare a form with enctype set to 'multipart/form-data' and then call 'submit' method of form to upload the file.
<form id="fm" action="..." enctype="multipart/form-data" method="post">
<input type="file" name="file">
<input type="button" onclick="javascript:$('#fm').form('submit')">upload</input>
</form>