When insert a row to datagrid, the 'column-value' mapping must be specified. If you want to insert a raw array such as ('new name', 30, 'some messages'), this array must be converted to {name:'new name',age:30,note:'some messages'} before insert to datagrid. You could extend a new method to do so.
$.extend($.fn.datagrid.methods,{
insertRow2: function(jq,param){
return jq.each(function(){
var col1 = $(this).datagrid('getColumnFields',true);
var col2 = $(this).datagrid('getColumnFields',false);
var col = col1.concat(col2);
var row = {};
for(var i=0; i<param.row.length; i++){
row[col[i]] = param.row[i];
}
$(this).datagrid('insertRow', {index:param.index,row:row});
});
}
});
Now call 'insertRow2' method to do what you want.
var row = ['new name', 30, 'some messages'];
$('#dg').datagrid('insertRow2',{
index:1,
row:row
});