DirtyFileld on FormPanel

  1. #1

    DirtyFileld on FormPanel

    Hi.


    I use PagingToolBar to move back and Forward record using the related store:
    FormPanel Section:
    <ext:PagingToolbar ID="FormPanel_toolbar" StoreID="Store1" runat="server"  DisplayInfo="false"  HideRefresh="true" />

    Store Section:
      <DataChanged 
                        Handler="var record = this.getAt(0) || {};#{FormPanel}.getForm().loadRecord(record);  " 
                        Delay="10"  
        />
    How can I set DirtyField (not native in FormPanel) when I changed data in FormPanel in order to start the codebehind saving routine (SQL Update)?

    Thanks.
  2. #2
    Hello!

    Try to use updateRecord method like in this sample: http://examples2.ext.net/#/GridPanel/Update/AutoSave/
  3. #3
    Quote Originally Posted by Baidaly View Post
    Hello!

    Try to use updateRecord method like in this sample: http://examples2.ext.net/#/GridPanel/Update/AutoSave/
    Thanks for Your answer.

    I have applied the suggested approach in that way:

     <script type="text/javascript">
          var isSyncCheck = function (form) {
              if (form.getForm()._record == null) {
    
                  return;
              }
    
              if (form.getForm().isDirty()) {
                  DDT.saveItem(); //Codebehind function saving the form data
    
                  return;
              }
    
    
          };
    
    </script>
    called by the BeforeDeselect event of a gridanel:
     <SelectionModel>
                                   <ext:RowSelectionModel ID="anagrafica_articoli_rowSelectionModel" runat="server"    >
                               <Listeners>
                               <BeforeDeselect Handler="isSyncCheck(#{Scheda_anagrafica_articolo_formpanel})" ></BeforeDeselect>
                               <Select Handler="#{Scheda_anagrafica_articolo_formpanel}.getForm().loadRecord(record);  " />
                               
                               </Listeners>
                               </ext:RowSelectionModel>    
                                </SelectionModel>

    In that way I have the autosave when another record is selected without SAVE button pressing.
    I'm trying to handle a Popup message to ask confirmation for automatic saving action.
    Any suggestion?

    Thanks.
    Stefano
  4. #4
    You need to save the record in callback function of confirm method: http://docs.sencha.com/extjs/4.1.3/#...method-confirm

    Here is sample: http://forums.ext.net/showthread.php...ll=1#post68113

Similar Threads

  1. Replies: 2
    Last Post: Oct 24, 2013, 12:53 PM
  2. FormPanel
    By nedimkeskin in forum 2.x Help
    Replies: 3
    Last Post: Jan 31, 2013, 1:10 PM
  3. Div, FormPanel
    By rookie in forum 1.x Help
    Replies: 3
    Last Post: Nov 22, 2012, 2:10 PM
  4. Can i use my own FormPanel in CalendarPanel
    By tonyls in forum 1.x Help
    Replies: 0
    Last Post: Mar 23, 2012, 5:57 AM
  5. Replies: 0
    Last Post: Nov 17, 2011, 11:53 AM

Tags for this Thread

Posting Permissions