I have edit page of some entity with tab with grid and serializer. So, above checkboxes we can see the dropdown which is responsible of list of chosen elements or non-chosen element or show all of ones. It doesn't work from me. When I press Yes/No and Search it doesn't affect getting items on ajax request.
Add column:
$this->addColumn(
'selected_countries',
array(
'type' => 'checkbox',
'index' => 'country_id',
'align' => 'center',
'name' => 'selected_countries',
'field_name' => 'selected_countries',
'values' => $this->getSelectedItems(),
)
);
layout update:
<reference name="left">
<block type="restrictshipping/adminhtml_rule_edit_tabs"
name="restrict_shipping_rule_edit_tabs"
as="rule.edit.tabs">
<block type="restrictshipping/adminhtml_rule_edit_tab_countriesList"
name="restrict_shipping_rule_edit_countries_list"
as="rule.edit.tab.countries.list">
</block>
<action method="addTab" >
<name>rule_edit_tab_countries_list</name>
<block>rule.edit.tab.countries.list</block>
</action>
</block>
<block type="adminhtml/widget_grid_serializer" name="related_grid_serializer">
<action method="initSerializerBlock">
<grid_block_name>restrict_shipping_rule_edit_countries_list</grid_block_name>
<data_callback>getSelectedItems</data_callback>
<hidden_input_name>selected_countries_ids</hidden_input_name>
<reload_param_name>country_id_reload</reload_param_name>
</action>
<action method="setFormId">
<id>edit_form</id>
</action>
</block>
</reference>
Also it doesn't send selected items IDs.
And there is a strange behavior:
public function getCondition()
{
if ($this->getValue()) {
return $this->getColumn()->getValue();
}
else {
return array(
array('neq'=>$this->getColumn()->getValue()),
array('is'=>new Zend_Db_Expr('NULL'))
);
}
//return array('like'=>'%'.$this->getValue().'%');
}
because Mage/Adminhtml/Block/Widget/Grid.php:470
I believe it must use in
if value === 1
and nin
if value === 0
and not use any filter when value === ''
. I don't understand how it can work...