[CLOSED] Formpanel - set isDirty() to false onload of page

  1. #1

    [CLOSED] Formpanel - set isDirty() to false onload of page

    Hi,
    In my cshtml page, i have a formpanel.
    This formpanel has lots of controls within it.
    On Ext.onReady() i set values to some of the controls, so for the formpanel FieldChange event is getting triggered.
    Now on a buttons click (even when user has not changed any field value) i check for formpanel isDirty(). it always returns true.
    As a thought is it possible to set isDirty of the form to false after setting control values in Ext.onReady event.
    So as to trap user made change again through isDirty().
    Last edited by Daniil; Aug 13, 2013 at 3:47 AM. Reason: [CLOSED]
  2. #2
    Hi @PriceRightHTML5team,

    I think it could be enough to set up TrackResetOnLoad="true" for a FormPanel in your scenario.
    http://docs-origin.sencha.com/extjs/...ackResetOnLoad
  3. #3
    Hi Daniil,
    I Applied to the form
     .TrackResetOnLoad(true)
    but still
    App.FrmEditRefRules.getForm().isDirty()
    is always true (even when user has not made any changes to the form controls).

    Following is my script in Ext.onReady event.

    Ext.onReady(function(){      
            App.cntrlnm.hide();    // Hide Alternate Accordian
            App.Cmbxyz.setValue('@ViewBag.Selectedxyz');
        });
    Last edited by Daniil; Aug 05, 2013 at 6:35 AM. Reason: Please use [CODE] tags
  4. #4
    I thought you use a form's setValues method.

    For you case, you should make a field not dirty.
    App.Cmbxyz.setValue('@ViewBag.Selectedxyz');
    App.Cmbxyz.originalValue = App.Cmbxyz.getValue(); // to reset its dirty
  5. #5
    Hi Daniil,
    I checked the value of isDirty() at very begining of Ext.onRead() i.e. before setting/updating control values to through script, it is true

    Ext.onReady(function(){
            App.Frmnm.getForm().isDirty();    // shows true
            App.cntAltPanel.hide();    
            App.Cmbbox.setValue('@ViewBag.SelectedCountry');
            App.CmbboxoriginalValue = App.Cmbbox.getValue();
    I guess it should have been false
  6. #6
    Please provide a test case.

Similar Threads

  1. Replies: 1
    Last Post: May 13, 2013, 2:40 PM
  2. Replies: 2
    Last Post: Apr 18, 2013, 2:49 AM
  3. gridpanel dinamic onload page
    By maxdiable in forum 1.x Help
    Replies: 1
    Last Post: Feb 16, 2012, 8:07 AM
  4. [CLOSED] [1.0] FormPanel isDirty() problem with CompositeField
    By idrissb in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 14, 2010, 6:57 PM
  5. [CLOSED] how to set Formpanel isdirty=false
    By vali1993 in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Jul 30, 2010, 2:35 PM

Tags for this Thread

Posting Permissions