简体   繁体   English

默认情况下,在magento管理网格中获取所有预选择的行

[英]Getting all rows pre-selected by default in magento admin grid

I am getting all the rows pre-selected by default on page load in magento admin grid. 我正在magento管理网格中默认情况下在页面加载时预先选择所有行。

Due to this when I select fields and apply mass action error appears ie 'Please select items.' 因此,当我选择字段并应用大规模操作错误时,即出现“请选择项目”。

For reference please find the snaps below: 作为参考,请在下面找到快照:

All Fields are selected : 选择所有字段:

已选择所有字段...

Still getting error: 仍然出现错误:

在此处输入图片说明

Any Kind of help would be appreciated.. 任何帮助将不胜感激。

You can get it working with jquery by writing following code : 您可以通过编写以下代码来使其与jquery配合使用:

jQuery('a:contains("Select All")').click(); jQuery('a:contains(“全选”)')。click();

On the document ready in page where you want to autoselect all items in a grid. 在您要自动选择网格中所有项目的“准备就绪”页面上。

I found the issue. 我发现了问题。

In the mass action field I have set wrong name. 在大规模行动字段中,我设置了错误的名称。 Once I replaced it with the correct index name of the column the issue is resolved. 用正确的列索引名替换它后,问题就解决了。

A snippet of the code is as follows: 该代码的片段如下:

parent::_prepareMassaction();
$this->setMassactionIdField('entity_id');
$this->setMassactionIdFilter('entity_id');
$this->setMassactionIdFieldOnlyIndexValue(true);
$this->getMassactionBlock()->setFormFieldName('sellers');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM