模块 Prestashop HelperList 位置
Module Prestashop HelperList Position
我创建了我的模块,并在创建 ListForm 时添加了 "Position" 列,如 Prestashop Doc 中所示,但我没有显示拖放的箭头,也没有拖放的可能性降低。 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
你需要添加这个:
$helper->position_identifier = 'position';
$helper->orderBy = 'position';
$helper->orderWay = 'asc';
我创建了我的模块,并在创建 ListForm 时添加了 "Position" 列,如 Prestashop Doc 中所示,但我没有显示拖放的箭头,也没有拖放的可能性降低。 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
你需要添加这个:
$helper->position_identifier = 'position';
$helper->orderBy = 'position';
$helper->orderWay = 'asc';