PDA

View Full Version : String data type not accepted.



Santosh Dhumale
5 Sep 2012, 1:40 AM
Hello,

I have very strange problem. I used grid editor and I get the data in following format.

[{"nozzelno":"N1","nozzelid":130,"pmsid":2,"pipingclass":"B5A","santosh":1,"counter":1},{"nozzelno":"N2","nozzelid":131,"pmsid":2,"pipingclass":"B5A","santosh":1,"counter":2}].

I am able to bind this data to grid.

I used rendrer for counter column which return a herf to # like

nozzeldetailgrid = Ext.create('Ext.grid.Panel', {
columnLines: true,
store: nozzeldetailstore,
columns: [{
header: 'SR NO',
dataIndex: 'counter',
editor: {
xtype : 'textfield',
readOnly : true

},
renderer : function(val, meta, record) {
var nozzelno=record.data.nozzelno;
var nozzelid=record.data.nozzelid;
var pmsid=record.data.pmsid;

return '<a href="#" onclick="displayequipmentsummarytabs('+pmsid+','+nozzelid+','+nozzelno+')">'+val+'</a>';
}
},


when I called that function I get both the pmsid and nozzelid which are int type .
and when I try to get nozzelno which is String type I get an Reference Error .N1 is not defined.

I am not getting this problem where I can get non String data type values but not String type values.

Please help me.

droessner
5 Sep 2012, 4:38 AM
You are sending nozzleno to your displayequipmentsummarytabs function as a variable instead of a string. You just need to add some quotes.



return '<a href="#" onclick="displayequipmentsummarytabs('+pmsid+','+nozzelid+',\''+nozzelno+'\')">'+val+'</a>';

Santosh Dhumale
5 Sep 2012, 4:40 AM
Thank you.
It worked.