Works great, thanks.
Anyway to make sure new title is reflected in 'options', and to add as a dg method, i made a little change:
$.extend($.fn.datagrid.methods, {
setTitle: function(jq,data) { // data: { 'field':fieldname, 'title':newtitle }
return jq.each(function() {
// set datagrid 'options' array
var cols=$(this).datagrid('options').columns[0]; // no extra headers in my code
for (var n=0; n<cols.length;n++) {
if (cols[n].field!==data.field) continue; // not found: continue
cols[n].title=data.title; // found: set new title
break; // no need to continue iteration
}
// change rendered layout
var panel = $(this).datagrid('getPanel');
var fld = $('td[field='+data.field+']',panel);
if(fld.length) $('span', fld).eq(0).html(data.title);
});
}
});
Perhaps now not too much complicated elaborate a more generic 'setTitles' method :-)... but out of my scope.
Thanks for the code
Juan Antonio