0

I need to selected checkbox value in Admin Grid and edit are of admin I need to know

that what way i need to save that in database...

and how to get and show selected in grid and edit form in admin ..

my save way

$checkString = serialize($this->getRequest()->getPost('ecommerce_sites'));

and the whole array is saved in data base..

i need to know that how to get and show check box in edit in admin of magento

  • Hi Deepak and welcome to MAgeOverflow. Unfortunately I don't understand the question. Do you talk about products? Is the checkbox an attribute or a custom option? Something else? Please explain further what you try to achieve. Edit your post and request reopening. – Fabian Blechschmidt Nov 14 '14 at 10:19
  • @FabianBlechschmidt thanks.. the problem is now solved – Deepak Kumar Nov 14 '14 at 10:30
  • Then please delete the question, I don't think the question is helpful for anyone else :-) – Fabian Blechschmidt Nov 14 '14 at 10:32
  • 1
    @FabianBlechschmidt I answered if this answer is not good..then i can delete .....I use to show multiple checkbox seleted from serialize value to array – Deepak Kumar Nov 14 '14 at 10:36
  • Answered question are always worth keeping them :-) Thanks for the answer! – Fabian Blechschmidt Nov 14 '14 at 11:06
1

if we want to get serialized data from collection. then use...

$sellerId = $this->getRequest()->getParam('id');
$sellerModel = Mage::getModel('seller/seller')->load($sellerId);

$sellerModel = $sellerModel->setSellerOtherSaleSites(unserialize($sellerModel->getSellerOtherSaleSites()));

after that on grid form on edit  we can use ....for check box for multiple select...
$fieldset->addField('seller_other_sale_sites', 'checkboxes', array(
                                  'label'     => Mage::helper('seller')->__('Checkboxs'),
                                  'name'      => 'seller_other_sale_sites',
                                  'values' => array(
                                                    array('value'=>'eBay','label'=>'eBay'),
                                                    array('value'=>'Flipkart','label'=>'Flipkart'),
                                                    array('value'=>'Myntra','label'=>'Myntra'),
                                                    array('value'=>'Snapdeal','label'=>'Snapdeal'),
                                                    array('value'=>'Tradus','label'=>'Tradus'),
                                                    array('value'=>'Shopclues','label'=>'Shopclues'),
                                                    array('value'=>'None','label'=>'None of these'),

                                               ),
                                  'onclick' => "",
                                  'onchange' => "",
                                  'value'  => '1',
                                  'disabled' => false,
                                  //'after_element_html' => '<small>Comments</small>',
                                  'tabindex' => 1
                                ));
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.