View Full Version : [ask] get key from store

5 Aug 2015, 1:31 AM
i have an example for data store like this:

"Text": " alpha",
"qtip": {
" total":"300"

and then i have grid column like this

header: "Total Row",
dataIndex:" qtip.total"

if i run that code, the value of my grid for total row will be 300.
well, how if i want to show the key, not "300" but "total" .??
i've try to make function in renderer :

for(y in record.get('qtip')){

but it failed. please help me.

6 Aug 2015, 9:36 AM
Have a look at the other params in your renderer function:

renderer: function(value, metaData, record, rowIndex, colIndex){

6 Aug 2015, 6:06 PM
hi thx for you reply,

the result for your suggest is the value of dataIndex right. in my ex code above, the result will be "qtip". I can get "total" when i change the value of dataIndex to "total". But how if have store like this :


how if i want to get only "total2" and "total3" ..??

14 Aug 2015, 5:46 AM
dataIndex: 'qtip',
renderer: function(value) {
var totalAttr = Ext.Object.getKeys(value); //['total', 'total2', 'total3']
// ... do logic
// return value to render
return totalAttr; // This will return joined array "total, total2, total3"