Results 1 to 2 of 2

Thread: The TPL COMPONENT not updated when the value of the record is set to null.

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

    Default The TPL COMPONENT not updated when the value of the record is set to null.

    Class Component.js
    This method is call a example when obj.setRecord(null);
    Code:
    updateRecord: function(newRecord, oldRecord) {
        var me = this;
    
        if (oldRecord) {
            oldRecord.unjoin(me);
        }
    
        if (!newRecord) {
            me.updateData('');     <--- CALL THIS INSTRUCTION 
        }
        else {
            newRecord.join(me);
            me.updateData(newRecord.getData(true));
        }
    }
    
    
    
    //NEXT CALL with  newData=''
    
    
    /**
     * @private
    */
    updateData: function(newData) {
        var me = this;
        if (newData) { //with newData equal to '' do not will enter into this if
            var tpl = me.getTpl(),
                tplWriteMode = me.getTplWriteMode();
    
            if (tpl) {
                tpl[tplWriteMode](me.getInnerHtmlElement(), newData);
            }
    
            /**
             * @event updatedata
             * Fires whenever the data of the component is updated
             * @param {Ext.Component} this The component instance
             * @param {Object} newData The new data
             */
            this.fireEvent('updatedata', me, newData);
        }
    },

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    9,792
    Vote Rating
    260
      0  

    Default

    Thanks for the report. Can you please post a test case which reproduces the behavior you're seeing?
    https://fiddle.sencha.com/#home


    Join me at SenchaCon 2016!

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
  •