Don't clearly know what you want to do. If want to set the column's customized value when end editing a row, try the code below:
// extend your custom text editor
$.extend($.fn.datagrid.defaults.editors,{
customtext:{
init: function(container, options){
var input = $('<input type="text" class="datagrid-editable-input">').appendTo(container);
input.data('customtext',{options:options});
return input;
},
getValue: function(target){
var value = $(target).val();
var opts = $(target).data('customtext').options;
if (opts.callback){
opts.callback.call(target, value);
}
return value;
},
setValue: function(target, value){
$(target).val(value);
},
resize: function(target, width){
$(target)._outerWidth(width);
}
}
});
Apply the 'customtext' editor to a column.
<th data-options="field:'attr1',width:250,editor:{
type:'customtext',
options:{
callback:function(value){
var col = $('#dg').datagrid('getColumnOption','attr1');
col.value = value;
}
}
}">Attribute</th>