1. #1
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    140
    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 User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Answers
    498
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      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
    140
    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 User skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,338
    Answers
    498
    Vote Rating
    248
    skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of skirtle has much to be proud of

      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
    140
    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

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar