HTML escaping in GridX

282 Views Asked by At

Does GridX support HTML escaping for texts in cells?

I've failed to find the attribute like escapeHTMLInData from dojox.grid.DataGrid.

Does GridX has built-in HTML escaping, or one need to write a module for that, evt. manually escape the text fields before setting them in grid?

1

There are 1 best solutions below

0
On BEST ANSWER

GridX, from version 1.3, has build-in HTML escaping, which is activated by parameter encode: true to the grid structure:

var structure = [
    { id: 'name', field: 'name', name: 'Name', encode: true},
    { id: 'city', field: 'city', name: 'City', encode: true},
    { id: 'score', field: 'score', name: 'Score}
];

var grid = Grid({
      id: 'grid',
      cacheClass: Cache,
      store: store,
      structure: structure
});