Results 1 to 2 of 2

Thread: how to execute javascript with itemTpl of Ext.List

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    30
    Vote Rating
    0
      0  

    Default how to execute javascript with itemTpl of Ext.List

    in my existing code, this works
    Code:
    var list = Ext.create('Ext.List', {
    ...,
    itemTpl: '<div>{id}</div>',
    ...
    });
    however, i wish to run a javascript function and this does not work

    Code:
    itemTpl: '<div>' + class.getNameFromId('{id}') + '</div>';
    any ideas? the function runs, but the value of {id} does not give the output
    Last edited by chitgoks; 11 Sep 2012 at 7:32 PM. Reason: reedit

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Use a member function. Look at last example in the intro docs http://docs.sencha.com/touch/2-0/#!/api/Ext.XTemplate
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •