All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
  Print view

o2m - grid save how to refresh parent node?
Author Message
PostPosted: Tue Mar 15, 2016 1:19 pm 
Regular
User avatar
Offline

Joined: Thu Aug 25, 2011 9:31 pm
Posts: 308
Location: Mumbai, India
when saving editable grid following code is called from atk/datagrid/class.atkdatagrid.inc
Code:
:
  /**
   * Returns a JavaScript call to save the current grid's contents when in edit mode.
   *
   * @return string JavaScript call (might need escaping when used in HTML code)
   */
  public function getSaveCall()
  {
    $url = session_url(dispatch_url($this->getNode()->atkNodeType(), 'multiupdate', array('output' => 'json')), SESSION_PARTIAL);
    atkimport('atk.utils.atkjson');
    return 'ATK.DataGrid.save('.atkJSON::encode($this->getName()).', '.atkJSON::encode($url).');';
  }
:


SESSION_PARTIAL : this is PARTIAL ajax call .... but i wish to refresh the full page ... how to do it any idea?

reason : action_multiupdate() mentioned above works fine and i get control of each row and and i myself save it using updateDb() ..... also i update parent node table for totals etc.... it is updated properly in database but since while page is not refreshed --- users do not see the effect.


Top
 Profile  
 

Re: o2m - grid save how to refresh parent node?
PostPosted: Sun Apr 22, 2018 10:21 pm 
Offline

Joined: Wed Mar 14, 2018 10:18 am
Posts: 3
Esto funciono para mi.

Code:
   public function postAdd(&$record){
      $this->_redirectOrder($record);
      return true;
   }   

   function postDelete($record){
      $this->_redirectOrder($record);
      return true;      
   }      
   
   protected function _redirectOrder($record){

      $movimiento_id = $record['movimiento_id'];

      $atksaveandnext = $this->m_postvars['atksaveandnext'];
      if (empty($atksaveandnext)){
         if (!empty($movimiento_id)) {
            $pparams["atknodetype"] = "administrador.factura";
            $pparams["atkselector"] = "a_movimientos.id='".$movimiento_id."'";
            $pparams["atkprevlevel"] = 0;
            $pparams["atklevel"] = 1;
            $pparams["atkstackid"] = atkStackID();
            
            $url = dispatch_url("administrador.factura", "edit", $pparams);
            $this->redirect($url);
            die();
         }

      }
   }


Top
 Profile  
 

Re: o2m - grid save how to refresh parent node?
PostPosted: Fri May 04, 2018 2:13 am 
Regular
User avatar
Offline

Joined: Thu Aug 25, 2011 9:31 pm
Posts: 308
Location: Mumbai, India
tks piermartiri but i m talking about GridEdit Save Button. This is partial HTML save and $this->redirect($url); does NOT work as per my experience.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group