Well, you'd certainly know more about it than me, so what I'm doing may have some bad side-effects. But this seems effective:
var detailview2 = $.extend({}, detailview, {
updateRow:function (target, rowIndex, row) {
var dc = $.data(target, 'datagrid').dc;
var opts = $.data(target, 'datagrid').options;
var cls = $(target).datagrid('getExpander', rowIndex).attr('class');
$.fn.datagrid.defaults.view.updateRow.call(this, target, rowIndex, row);
$(target).datagrid('getExpander', rowIndex).attr('class', cls);
// update the detail content
if (this.canUpdateDetail) {
var row = $(target).datagrid('getRows')[rowIndex];
var detail = $(target).datagrid('getRowDetail', rowIndex);
detail.html(opts.detailFormatter.call(target, rowIndex, row));
if (opts.onExpandRow) {
opts.onExpandRow.call(this, rowIndex, row);
}
}
}
});
Is there something wrong with this that I'm not noticing?