Results 1 to 4 of 4

Thread: 4.2 Grouped grid sends empty records to convert function in model

  1. #1
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    78
    Vote Rating
    9
      0  

    Exclamation 4.2 Grouped grid sends empty records to convert function in model

    In 4.2 if I group a grid by a column that has a convert function in the model the grid will not render correctly when grouped.

    I have this convert function in my model:
    Code:
    {            name : 'someDate',
                type : 'string',
                mapping : 'some_time',
                convert : function(value, record) {
                   return Ext.util.Format.date(Ext.Date.parse(value, 'c'), l10n.dateTimeFormatStrings.shortDateFormat + " "
                         + l10n.dateTimeFormatStrings.shortTimeFormat);
                }
             }
    If I group my grid by this column the value in the convert function == "". The record.raw == undefined. And the record.data.someDate = "". There is never any non-"" value passed to the convert function when grouped.

    So, here is the grid pre-grouping:
    gridungrouped.png

    Here is the grid while on a breakpoint in the convert function where the value is ALWAYS "". Interesting that it renders correctly BEFORE processing the null record values...:
    groupedonbreakpoint.png

    And here is what it renders at once it has processed the convert function:
    groupedbroken.png

    Now, I could avoid doing the convert here and do it on the renderer function of the column in the grid. The problem with that is that the grouped header then has the UNCOVERTED value displayed. So the value in the grid and the value in the grouped header is not the same?! If there is at least a way to CONDITIONALLY render the groupHeaderTpl that would be an acceptable workaround.

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

    Default

    Testing one of the examples that comes with 4.2.0 (grid/group-summary-grid.html) I added this to the project field:

    Code:
    convert : function(val) {
        return val + '1';
    }
    expecting it to break like you have but I do not see anything I don't expect, I see the project field values have a 1 at the end.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    1,017
    Vote Rating
    125
      0  

    Default

    Hello,

    There is definitely a problem.

    Here is a bug report.
    http://www.sencha.com/forum/showthread.php?260888
    Object.NET
    Frameworks and Tools for .NET Developers
    --------------------------------------------------
    Ext.NET - Ext JS for ASP.NET - Examples | Twitter
    Bridge.NET - Write C#. Run JavaScript! - Live | Twitter
    --------------------------------------------------

  4. #4
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    78
    Vote Rating
    9
      0  

    Default

    Thanks, Daniil. I'll follow that thread.
    Quote Originally Posted by Daniil View Post
    Hello,

    There is definitely a problem.

    Here is a bug report.
    http://www.sencha.com/forum/showthread.php?260888

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
  •