Hi,
Extracting data from XML I want to preprocess one before sending it as a variable to template. A stackoverflow fellow pointed me to Ext.Xtemplate and that is close to do the job.
In each of my recors I have a value "coordinates" of this pattern : 2.342556,48.873802,0.000000
3 items separated with comma. I need the first and the second.
So I decided to split but It doesn't work.
My attempt so far (trying to display only one value for testing purposes)
Code:
var tpl = new Ext.XTemplate( '<div>{name}<br>{[ values.coordinates.split(',')[1] ]}</div>'
);
This echo nothing. If I display the [0] column of the array it displays the whole string, unsplited. This means that it didn't parse the comma.
If I split with something else it works (for example with an integer)
Code:
var tpl = new Ext.XTemplate( '<div>{name}<br>{[ values.coordinates.split(6)[1] ]}</div>'
);
I tried to split with the point ('.') but it throw an error ("unexpected string")
Maybe I should use a template member function but the example in the doc are not very clear for me.
Thanks for your help,
Julieus