简体   繁体   中英

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.

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('a:contains("Select All")').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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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