PDA

View Full Version : Grid dataIndex customisation and my misunderstanding



Ferret_228
18 Apr 2012, 9:37 PM
hello,

I want to put some custom data in to column field... my data located at the local store.

code of my grid:


columns: [
{text: "name", flex: 1, dataIndex: 'name'},
{text: "type", flex: 1, dataIndex: 'type'},
{text: "value", flex: 1, dataIndex: 'function', renderer: this.rendeValueColumn},
{text: "parameter", flex: 1, dataIndex: 'parameter'},
{text: "rule", flex: 1, dataIndex: 'rule'}
],

i want to change 'rule' .

i'm try to : var a = 'test'; {text: "rule", flex: 1, dataIndex: a} etc...

but that way arent help me...

scottmartin
19 Apr 2012, 10:47 AM
You can use a renderer for that:



function myRule(val,meta,record){
return val; // make changes here.
}

{ text: "rule", flex: 1, dataIndex: 'rule', renderer: myRule }


Regards,
Scott.