Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Parameters for groupTextTpl

  1. #11
    Sencha User
    Join Date
    May 2008
    Location
    Paris
    Posts
    4

    Default identify groupField

    Try something like that to check what type of field the grid is grouped by.

    groupTextTpl: '<tpl if="groupId.indexOf(\'storefieldname1\') != -1">storefieldname1 {text}</tpl>' +
    '<tpl if="groupId.indexOf(\'storefieldname2\') != -1">storefieldname2 {text}</tpl>'

    Philou

  2. #12
    Ext JS Premium Member smokeman's Avatar
    Join Date
    Jul 2007
    Posts
    475

    Default you are a lifesaver!!!

    This saved me a ton of searching...
    I did a google search on extjs for groupTextTpl, and this was on the first page!
    this should be in the grid faq, for easy reference.

    I had an instance where I needed to set the grouping title to the name of another field, and this worked like a charm!

    Quote Originally Posted by John Holmes View Post
    Hi,

    Have a try with

    Code:
    groupTextTpl: '{[ values.rs[0].data["storefieldname"] ]}'
    this should works

    P.S: remember to use [] inner the {} template markers.
    here is what I actually did:
    Code:
    groupTextTpl: '{[values.rs[0].data["wb_name"]]}({[values.rs.length]} {[values.rs.length > 1 ? "Reports" : "Report"]})'

  3. #13
    Ext User
    Join Date
    Jun 2008
    Location
    Menden, Germany
    Posts
    25

    Default

    Why do I get "undefined" for some fields (in this example "logo" in the recordset which are in the query?

    Code:
    view: new Ext.grid.GroupingView({
                                        showGroupName: false,
                                        groupTextTpl: '<img src=./bilder/Logo_{[values.rs[0].data["logo"]]}_16x16.png> {text} ({[values.rs.length]} {[values.rs.length > 1 ? "Rechner" : "Rechner"]})'
                                    }),

  4. #14
    Sencha User
    Join Date
    Jan 2010
    Posts
    4

    Default Undefined fields...

    Are the fields defined as columns in the grid itself?

  5. #15

    Default

    Thanks John!It worked for me.

Page 2 of 2 FirstFirst 12

Posting Permissions

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