模块Prestashop HelperList位置

问题描述 投票:0回答:1

我创建了我的模块,在创建ListForm时,我添加了 "位置 "列,就像在Prestashop文档中看到的那样,但我没有出现拖放的箭头,也没有拖放的可能性。Prestashop 1.7

    if ($result = Db::getInstance()->executeS($sql)) {
    //Les champs à afficher
        $this->_defaultOrderBy = 'position';
        $this->fields_list = array(
         'id_slider' => array(
             'title' => 'ID',
             'width' => 'auto',
             'type' => 'text'
             ),
         'commentaire' => array(
             'title' => $this->l('commentaire'),
             'width' => 'auto',
             'type' => 'text'
           ),

           'link' => array(
               'title' => $this->l('link'),
               'width' => 'auto',
               'type' => 'text'
             ),
             'test' => array(
              'title' => $this->l('active'),
              'active' => 'test',
              'width' => 'auto',
              'type' => 'bool',
              'ajax' => true,
              'align' => 'center'
              ),
              'position' => array(
                'title' => $this->l('Ordem'),
                'filter_key' => 'a!position',
                'position' => 'position',
                'align' => 'center',
                'class' => 'fixed-width-md'
            ),
             'image' => array(
                 'title' => $this->l('image/video'),
                 'width' => 'auto',
                 'type' => 'text'
              ),
             'videocover' => array(
                 'title' => $this->l('image/video'),
                 'width' => 'auto',
                 'type' => 'text'
               ),
               'imagemobile' => array(
                   'title' => $this->l('image/video'),
                   'width' => 'auto',
                   'type' => 'text'
                 ),
                 'imagepng' => array(
                     'title' => $this->l('image/png'),
                     'width' => 'auto',
                     'type' => 'text'
                   ),
                 'imagepngmobile' => array(
                     'title' => $this->l('image/png'),
                     'width' => 'auto',
                     'type' => 'text'
                   )
         );
        $helper = new HelperList();
        $helper->shopLinkType = '';
        $helper->simple_header = false;
        $helper->identifier = 'id_slider';
        $helper->actions = array('edit', 'delete');
        $helper->show_toolbar = true;
        $helper->title = $this->displayName;
        $helper->table = $this->name;
        $helper->token = Tools::getAdminTokenLite('AdminModules');
        $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
        $helper->toolbar_btn['new'] = array(
        'href' => AdminController::$currentIndex.'&configure='.$this->name.'&new='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'),
        'desc' => $this->l('Nouveau slider')
     );
        return $helper->generateList($result, $this->fields_list);
    }

    return false;
}

我把你的图像与我的期望和我有什么发现的例子,我希望有 els felches的一面。

enter image description hereenter image description here

php module prestashop prestashop-1.7 prestashop-helper-classes
1个回答
2
投票

你需要添加这个..:

$helper->position_identifier = 'position';
    $helper->orderBy = 'position';
    $helper->orderWay = 'asc';
© www.soinside.com 2019 - 2024. All rights reserved.