Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6639261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:32:00+00:00 2026-05-25T23:32:00+00:00

The documentation about List mention that itemTpl follows the XTemplate syntax. I would like

  • 0

The documentation about List mention that itemTpl follows the XTemplate syntax.

I would like to use member functions in my itemTpl

If I initialize itemTpl with an XTemplate and that the member function has no argument it works:

            items: {
            xtype: 'list',
            store: myStore,
            itemTpl: new Ext.XTemplate('<i>{name} {[this.hello()]}</i>', {
                hello: function () {
                    return 'Hello';
                }
            })

But as soon as I try to pass an argument (like in the two examples below) it does not work anymore:

            items: {
            xtype: 'list',
            store: myStore,
            itemTpl: new Ext.XTemplate('<i>{name} {[this.helloWorld(name)}</i>', {
                helloWorld: function (name) {
                    return 'Hello ' + name;
                }
            })


        items: {
            xtype: 'list',
            store: myStore,
            itemTpl: new Ext.XTemplate('<i>{name} {name:helloWorld}</i>', {
                helloWorld: function (string) {
                    return 'Hello ' + name;
                }
            })

TypeError: ‘undefined’ is not a function (evaluating ‘fm.helloWorld(values[‘name’])’)

I guess I should not create a new Ext.XTemplate object. Is there any solution to pass the member functions without creating a separate XTemplate?

Or should I give up on the List and build the list myself in the template?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:32:00+00:00Added an answer on May 25, 2026 at 11:32 pm

    The following code should work:

    items: {
        xtype: 'list',
        store: myStore,
        itemTpl: new Ext.XTemplate(
             '<i>{name} {[this.helloWorld(values.name)]}</i>', 
             {
                 compiled: true,
                 helloWorld: function (name) {
                     return 'Hello ' + name;
                 }
             })
    }
    

    your first example would work, with values.name instead of just name

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone point me to some documentation about how I can use an Iso
I know that there has to be quite a lot of documentation about this
I am confused by the documentation about the usage syntax-case, but what can f
I read the documentation and some articles that talk about the package, but I'm
Is there any documentation about the Obj module? I could only find a list
I'm looking the documentation about publishing the message to wall from Facebook app http://developers.facebook.com/docs/reference/dialogs/feed/
Apple really had bad documentation about how the provider connects and communicates to their
When reading some documentation about assertions, I found: java -ea -dsa Enables assertions in
I've read the documentation about __init__.py files and some nice questions here on SO,
I can't find any specific documentation about the dispatchPeriod variable in the Google Analytics

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.