Jack Allegrezza
10 Jul 2010, 12:59 PM
If you amke an xhtml doc then when GridView make the html for the table and tries to insert it to the body div it gets a js exception (only if xhtml) and some cell data contains html entities - the cell data needs to be escaped - it looks like it should be done in the cellTemplate as the template is making the hmtl from strings and data so it should escape?
any way here is a quick fix I did in GridView.doRender to make it work it works but is not the correct solution
for (var i = 0; i < colCount; i++) {
column = columns[i];
meta.id = column.id;
meta.css = i === 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
meta.attr = meta.cellAttr = '';
meta.style = column.style;
meta.value = column.renderer.call(column.scope, record.data[column.name], meta, record, rowIndex, i, store);
meta.value = meta.value.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
if (Ext.isEmpty(meta.value)) {
meta.value = ' ';
}
if (this.markDirty && record.dirty && Ext.isDefined(record.modified[column.name])) {
meta.css += ' x-grid3-dirty-cell';
}
colBuffer[colBuffer.length] = cellTemplate.apply(meta);
}
any way here is a quick fix I did in GridView.doRender to make it work it works but is not the correct solution
for (var i = 0; i < colCount; i++) {
column = columns[i];
meta.id = column.id;
meta.css = i === 0 ? 'x-grid3-cell-first ' : (i == last ? 'x-grid3-cell-last ' : '');
meta.attr = meta.cellAttr = '';
meta.style = column.style;
meta.value = column.renderer.call(column.scope, record.data[column.name], meta, record, rowIndex, i, store);
meta.value = meta.value.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
if (Ext.isEmpty(meta.value)) {
meta.value = ' ';
}
if (this.markDirty && record.dirty && Ext.isDefined(record.modified[column.name])) {
meta.css += ' x-grid3-dirty-cell';
}
colBuffer[colBuffer.length] = cellTemplate.apply(meta);
}