extjs apply formatting to grid column -
in extjs, if have grid definition this:
xtype: 'grid', store: 'somestore', flex: 1, frame: true, loadmask: true, titlecollapse: true, cls: 'vline-on', ref: '../somegrid', id: 'somegrid', columns: [ { xtype: 'gridcolumn', header: 'id', dataindex: 'someid', sortable: true, width: 100 }
is there way apply formatting column? example, field number , if wish set decimal precision..can it? or need apply formatting when store being loaded in java file? guess latter??
use "renderer" option. can define function there. example want show someid wrapped in tag:
columns: [ { xtype: 'gridcolumn', header: 'id', dataindex: 'someid', sortable: true, width: 100, renderer: function(value) { // logic here return "<b>" + value + "</b>"; } }
Comments
Post a Comment