PDA

View Full Version : One value from jsonResponse missing on my Grid



Albareto
19 Sep 2012, 12:35 AM
Hi there,

I have a grid with several columns and all of them show correctly the value except one that for some reason receives an undefined value, this is very weird and I have never seen it before.

I have created my own columns extending from Ext.grid.column.XXX (depending on the column) and it works perfectly for other values but not for this one, it just gets lost somewhere and I cannot find where, I have debugged since the request is thrown until the renderer but I am still not able to find where this value is lost, has someone seen something like this?

This is the definition of my column class:



Ext.define('BW.Column',
{
extend : 'Ext.grid.column.Column',
alias : 'widget.bw-column',

constructor : function(c)
{
Ext.apply(this, c);
this.callParent();
},

renderer : function(value, metaData, record, rowIndex, colIndex, store)
{
if (typeof value === 'undefined') return 'value is undefined!'; //just for the example
return BW.th.templates.plainText.apply({text: BW.exists(value.text) ? value.text : value});
}
});


This is the column as I generate it in my JSP:



{
"dataIndex": "implementationDate",
"enableResize": true,
"flex": 1,
"text": "Implementation date",
"hidden": false,
"isOperation": false,
"menuDisabled": false,
"showColumn": true,
"sortable": true,
"xtype": "bw-column",
"cls": "implementationDate "
}

Here you have a screenshot of my JSON response:

38775

where you can see that the implementationDate is present, and this is the output of the grid:

38776

Where you can see that for the "Implementation date" column the received value is undefined.

For all the other values I have no problem but this specific one is just missing.

Any idea of where my implementationDate value is would be highly appreciated :)

vietits
19 Sep 2012, 1:33 AM
You should check the store to see whether or not it is populated with data from server. What do your model and store look like?

Albareto
19 Sep 2012, 1:59 AM
You pushed the correct button, Sir. I had a missconfiguration on the Model. Solved now :)

Thanks for your support!!