1. #1
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default Answered: How can I assign a custom property to every element of an XTemplate

    Answered: How can I assign a custom property to every element of an XTemplate


    I would like to open a custom window based on a property name returned by a Json object. This json object builts the items of a View, and I would like to attach a custom property to each item of the XTemplate which will contain the value of the json object.

    After, it will be possible to read this property in the itemdblclick event of the View.

    How can I manage to do such a thing?

  2. You don't need to use the index. The second argument passed to the itemdblclick handler is the record.

    I'm not sure why you see it as a workaround. Getting data directly out of the store/record is how you're supposed to do it. Trying to bodge it into the HTML would be a workaround...

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,585
    Answers
    540
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Perhaps I've misunderstood the question but couldn't you just grab the record in the itemdblclick handler and use that to locate the property you're interested in? I don't see a good reason to store this information on the element.

  4. #3
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    Mh well the problem is that I'm creating a view from a JSON store, one of the properties from that json should be attached in some way to an item that will be templated with xtemplate, because there isn't a good place in html where it fits (it's a name of the extjs window class I should open). So yes I can grab the property when I'm in itemdblclick, but this property it's not a default one but something I want to create on the item.

    I don't even know if this is possible, actually I'm using a workaround accessing the store with the index obtained from itemdblclick params and it's working well.

  5. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,585
    Answers
    540
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    You don't need to use the index. The second argument passed to the itemdblclick handler is the record.

    I'm not sure why you see it as a workaround. Getting data directly out of the store/record is how you're supposed to do it. Trying to bodge it into the HTML would be a workaround...

  6. #5
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    141
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    Oh, ok thank you, so it's working fine. Thanks a lot!

Thread Participants: 1

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