1. #1
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    67
    Vote Rating
    5
    jkyoutsey is on a distinguished road

      0  

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

    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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,408
    Vote Rating
    851
    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


    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 @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 Daniil's Avatar
    Join Date
    Jun 2010
    Location
    Saint-Petersburg, Russia
    Posts
    975
    Vote Rating
    111
    Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all Daniil is a name known to all

      0  

    Default


    Hello,

    There is definitely a problem.

    Here is a bug report.
    http://www.sencha.com/forum/showthread.php?260888
    Ext.NET - ASP.NET for Ext JS
    MVC and WebForms
    Examples | Twitter

  4. #4
    Sencha Premium Member
    Join Date
    Aug 2012
    Posts
    67
    Vote Rating
    5
    jkyoutsey is on a distinguished road

      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

Thread Participants: 2

Tags for this Thread