Jump to content
jemmeli

comment faire une action backoffice "detail" ?

Recommended Posts

bonjour

 

j'ai fait une tour dans google a la recherche d'un exemple pour faire une boutton "detail" qui est genere par "helper view" dans le backoffice mais sans resultat le boutton est affiché par cette code dans mon controller :

 

public function renderList() {


       // ajout d'un bouttons detail pour chaque liste
       $this->addRowAction('details');

       return parent::renderList();
   }

 

mais lors de la click rien ne se passe malgre que j'ai faire la fonction responsable a cette action de click ajaxProcessDetails() :

 

public function ajaxProcessDetails() {
       if (($id = Tools::getValue('id'))) {
           // override attributes
           $this->display = 'list';
           $this->lang = false;
           $this->addRowAction('edit');
           $this->addRowAction('delete');
           $this->_select = '* FROM ps_blockpersoadmintexture';
           //$this->_join = 'LEFT JOIN `' . _DB_PREFIX_ . 'tab_lang` b ON (b.`id_tab` = a.`id_tab` AND b.`id_lang` = ' . $this->context->language->id . ')';
           //$this->_where = 'AND a.`id_parent` = ' . (int) $id;
           //$this->_orderBy = 'position';


           // get list and force no limit clause in the request
           $this->getList($this->context->language->id);
           // Render list
           $helper = new HelperList();
           $helper->actions = $this->actions;
           $helper->list_skip_actions = $this->list_skip_actions;
           $helper->no_link = true;
           $helper->shopLinkType = '';
           $helper->identifier = $this->identifier;
           $helper->imageType = $this->imageType;
           $helper->toolbar_scroll = false;
           $helper->show_toolbar = false;
           //$helper->orderBy = 'position';
           //$helper->orderWay = 'ASC';
           $helper->currentIndex = self::$currentIndex;
           $helper->token = $this->token;
           $helper->table = $this->table;
           $helper->position_identifier = $this->position_identifier;
           // Force render - no filter, form, js, sorting ...
           $helper->simple_header = true;
           $content = $helper->generateList($this->_list, $this->fields_list);

           echo Tools::jsonEncode(array('use_parent_structure' => false, 'data' => $content));

       }
       die;
   }

 

 

merci d'avence

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More