Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    48
    Vote Rating
    1
    teedev is on a distinguished road

      0  

    Default List.groupTpl cannot accept an XTemplate

    List.groupTpl cannot accept an XTemplate


    It seems that this bug is still there in Sencha Touch 2.x
    http://www.sencha.com/forum/showthre...t-an-XTemplate
    The solution there isn't working for 2.x. So I need an other solution. Thanks!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    List does not have a groupTpl config. The header text is what you return in the store groupers
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    May 2011
    Posts
    48
    Vote Rating
    1
    teedev is on a distinguished road

      0  

    Default


    The header text is what you return in the store groupers
    Where can I find informations about the "header text"? Under
    http://docs.sencha.com/touch/2-0/#!/....dataview.List I can't find any information about headers.

    Every group in my List must have an different group header which is set by 2 functions (getGroupTitle and getGroupScore). In ST1 I used this
    Code:
     groupTpl : new Ext.XTemplate('<tpl for=".">', 
    '<div class="x-list-group x-group-{id}">', 
    '<h3 class="x-list-header">{group:this.getGroupTitle}</h3>',
    '<div class="x-list-group-items">', '{items}', '</div>', '
    <div style="padding:4px 14px;">' + 'Total section score' + 
    ':&nbsp;&nbsp;<div style="float:right;">{group:this.getGroupScore}</div></div>', '</div>', '</tpl>', {
          getGroupTitle : function(group) {
             return .....
          },
          getGroupScore : function(group) {
            return ..... 
         }
        }),
    How to archive the same thing with ST 2x? I would be great if you can give me a short code example.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,015
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Check out the examples. You return a string and it's grouped off that.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    May 2011
    Posts
    48
    Vote Rating
    1
    teedev is on a distinguished road

      0  

    Default


    Check out the examples. You return a string and it's grouped off that.
    Thanks, I've already seen the examples. They doesn't help me. Because they are too simple.
    My store has 3 fields: group, question, score.

    I want to group the list items by the "group" field. But the content of this "group" field should'n be displayed. I want to display a string that depends on the content of the group field. In my code above it is delieverd by the getGroupTitle() function.

    And I want to display a total score of the score field of all items in the same group. This score is calculated by a funtion and is different in every group. In my code above it is the getGroupScore() function.

    It should look like this:

    MyGroupText1: total section score: 5
    ....items (Question, score)....
    MyGroupText2: total section score: 7
    ....items (Question, score)....
    MyGroupText3: total section score: 4
    ....items (Question, score)....

    How to do this?

Thread Participants: 1