Results 1 to 8 of 8

Thread: Renderer method is not called for bound value for displayfield in modern 6.7.0

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Oct 2013
    Posts
    40
    Vote Rating
    1
      0  

    Default Renderer method is not called for bound value for displayfield in modern 6.7.0

    ExtJS modern 6.7.0

    When I am using following config, renderer method is not called, when value is updated.
    Value is updated, but without renderer.

    Code:
    xtype:'displayfield',
    bind: '{selectedUser.updated}',
    renderer: function (val, field) {
        return Ext.Date.format(val, 'c');
    }

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,005
    Vote Rating
    -520
      -1  

    Default

    Thank you so much for your post. I apologize for the delay. I have shared this with the support staff to look into at their earliest convenience. Your patience is greatly appreciated!

    Thanks again,

    Michele


  3. #3
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    465
    Vote Rating
    -333
      0  

    Default

    Hello,

    I'm not able to reproduce the issue.Please check the below fiddle and if you still having problem then please update the fiddle to assist you in a better way.


    https://fiddle.sencha.com/#view/editor&fiddle/2sli


    Regards,
    Kumar
    Sencha Support.

  4. #4
    Sencha User
    Join Date
    Oct 2013
    Posts
    40
    Vote Rating
    1
      0  

    Default

    Hi. I don't know, how to save fiddle. Please, try this code with c 6.7.0 modern.

    Ext.define('App.Model', {
    extend: 'Ext.data.Model',
    fields: ['date']
    });


    Ext.application({
    name: 'Fiddle',
    launch: function () {
    dialog = Ext.create({
    xtype: 'dialog',
    title: 'Binding',
    width: 300,
    bodyPadding: 10,
    viewModel: {
    data: {
    // 'val': 2
    }
    },
    items: [{
    xtype: 'button',
    text: 'click',
    handler: function (button) {
    var model = Ext.create('App.Model', {
    date: new Date()
    });
    button.lookupViewModel().set('val', model);
    }
    }, {
    xtype: 'displayfield',
    anchor: '100%',
    fieldLabel: 'Second Field',
    bind: "{val.date}",
    renderer: function (val, field) {
    console.log(val);
    return Ext.Date.format(val, 'c');
    }
    }]
    });


    dialog.show();
    }
    });

    You can see, that when you press button - date changing, but renderer is not called.

  5. #5
    Sencha User
    Join Date
    Oct 2013
    Posts
    40
    Vote Rating
    1
      0  

    Default

    https://fiddle.sencha.com/#view/editor&fiddle/2t1d

    Could you confirm, that this is the bug?

  6. #6
    Sencha User
    Join Date
    Oct 2013
    Posts
    40
    Vote Rating
    1
      0  

    Default

    I found that to make renderer called in display field I should write

    Code:
    bind: {value: '.....'}
    instead of just

    Code:
    bind: '.....'
    Please, describe this in the documentation or make renderer called when plain bind string is used.
    I spent a lot of time until found this solution.

  7. #7
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    465
    Vote Rating
    -333
      0  

    Default

    Hello,

    This is not a bug as you would observe in the fiddle mentioned below,

    https://fiddle.sencha.com/#view/editor&fiddle/2t8d

    There are two ways to do the same thing


    1) bind : "{val.date}"
    2) bind : {
    'value' : '{val.date}'
    }


    You did this the second way which worked but the first way didn't, so to make it work you will need to set config defaultBindProperty to value as default value of defaultBindProperty in html.


    For more details see the documentation link:
    https://docs.sencha.com/extjs/6.6.0/...ltBindProperty

    Regards,
    Kumar
    Sencha Support.

  8. #8
    Sencha User
    Join Date
    Oct 2013
    Posts
    40
    Vote Rating
    1
      0  

    Default

    Yes, I already created overload.

Posting Permissions

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