1. #1
    Sencha User
    Join Date
    Dec 2012
    Posts
    10
    Vote Rating
    0
    CaryLi is on a distinguished road

      0  

    Default Help!!! dirtychange of form.panel only fires for the first time?

    Help!!! dirtychange of form.panel only fires for the first time?


    Dear friends,

    I had a form.panel and in the controller I need to listen the change event of this form:

    so in the controller:

    'TestForm': {
    dirtychange: function (form, isDirty) {
    if (isDirty) {
    alert('test')
    }
    }
    },

    my view level:

    Ext.define('mytest.TestForm', {
    requires: [ 'Ext.form.Panel', 'CAS.reportingAdmin.model.Report' ],
    extend: 'Ext.form.Panel',
    alias: 'widget.TestForm',
    title: 'TestForm',
    header: false,
    defaults:{
    xtype: 'textfield',
    style: 'margin-left:5px;\r\npadding:5px 2px 2px 2px;',
    border: false,
    columnWidth: 1,
    maxHeight: 25,
    anchor: '80%',
    labelWidth: 240,
    labelStyle: 'font-weight: bold',
    labelAlign: 'left',
    layout: {
    type: 'anchor'
    }
    },
    config: {
    layout: {
    type: 'anchor'
    },
    padding: 5,
    items: [
    {
    fieldLabel: ' Name',
    name: 'tName',
    },
    ],
    buttons: [
    {
    id: 'saveBtnId',
    style: 'float:right;',
    height: 25,
    margin: '10px',
    width: 100,
    text: 'Save',
    scope: this,
    action: 'save',
    disabled: 'true'
    }
    ]
    }
    });


    the dirtychange event only fires for one time , actually for the first time , anyone can help?
    Really really appreciate...

    Regards,
    Cary

  2. #2
    Sencha User
    Join Date
    Dec 2012
    Posts
    10
    Vote Rating
    0
    CaryLi is on a distinguished road

      0  

    Default


    More Detail:

    I tried use reset() method to reset the form panel, then the dirtychange can fires everytime, but the new added stuff to the form field is not there, so I can't use reset.
    but the reset can really promote the dirtychange, so I am wondering what the stuff reset did for the form?

    and I searched from google, use this way || basicForm.owner.getForm().trackResetOnLoad = true; but the dirtychange still fires for only once? I spent a lot of time on it , please help???

Tags for this Thread