Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: grouping grid with the first char

Hybrid View

Previous Post Previous Post   Next Post Next Post
    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-9184 in a recent build.
  1. #1
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    232
    Vote Rating
    2
      0  

    Default grouping grid with the first char

    I use ExtJs 4.1.3 and Architect.
    I've got a grid with the fields: name and surname.
    I need to group the surname by the first char, for example:

    A:
    ANDERSON GINA
    ANDERSON PAOLA

    B:
    BAT MAN
    BAT MOBILE

    ...

    I set the groupField= surname[0] but It doesn't work...
    Any solution?
    Thanks.

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    145
      0  

    Default

    You can override the "getGroupString" method on your grouper to return the first character of that field.
    Aaron Conran
    @aconran

  3. #3
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    232
    Vote Rating
    2
      0  

    Default

    It works with ExtJ s4.1.3 but withExtJs 4.2 no!

  4. #4
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    145
      0  

    Default

    Interesting; sounds like a Ext JS 4.2 bug. Could you provide a simple example for me to pass along to the Ext JS team?
    Aaron Conran
    @aconran

  5. #5
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    232
    Vote Rating
    2
      0  

    Default see the test||

    this is my attachment.
    Thanks.
    Attached Files Attached Files

  6. #6
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    232
    Vote Rating
    2
      0  

    Default any solution?

    Quote Originally Posted by aconran View Post
    Interesting; sounds like a Ext JS 4.2 bug. Could you provide a simple example for me to pass along to the Ext JS team?
    Any solution?

  7. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,607
    Vote Rating
    59
      0  

    Default

    The store needs to be configured with

    Code:
    groupers: {
                        property: "nome",
                        getGroupString: function(record) {
                            debugger;
                            return record.get('nome')[0];
                        }
                    },

  8. #8
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    232
    Vote Rating
    2
      0  

    Default

    Did you read my next post about the override?

  9. #9
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    145
      0  

    Default

    The override needs to run before the beforerender.

    Link it as a static file resource, click + at the top of the inspector -> Resource -> JS Resource. This is where the override belongs.
    Aaron Conran
    @aconran

  10. #10
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,607
    Vote Rating
    59
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Page 1 of 2 12 LastLast

Posting Permissions

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