1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    6
    Vote Rating
    0
    Julius Fatherofkraken is on a distinguished road

      0  

    Default Javascript issue inside Ext.Xtemplate

    Javascript issue inside Ext.Xtemplate


    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

  2. #2
    Sencha User
    Join Date
    Nov 2011
    Posts
    6
    Vote Rating
    0
    Julius Fatherofkraken is on a distinguished road

      0  

    Default Double quote

    Double quote


    I solved it with a double quote escape

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi