6

I have created a custom magento extension that lists the products in the same way as 'Manage Products' but with an extra input column where people can enter a quantity for each row which is then used to generate a CSV file.

I have got this to work but I have seen an issue where you can select some products and change page and the products are still selected but the quantity that the user has entered is lost. How can I save the quantity added to the new custom input fields with the selected products.

I am assuming that something is used in grid.js to save the details but I haven't been able to find the correct function.

Anyone have any ideas?

0

This excellencemagentoblog.com article is a good place to learn about Grid Serializer

Pay attention to this piece of code

<test_adminhtml_test_customer>
       <block type="core/text_list" name="root" output="toHtml">
           <block type="test/adminhtml_test_edit_tab_grid" name="customer.grid"/>
           <block type="adminhtml/widget_grid_serializer" name="grid_serializer">
               <reference name="grid_serializer">
                   <action method="initSerializerBlock">
                       <grid_block_name>customer.grid</grid_block_name>
                       <data_callback>getSelectedCustomers</data_callback>
                       <hidden_input_name>links[customers]</hidden_input_name>
                       <reload_param_name>customers</reload_param_name>
                   </action>
                   <action method="addColumnInputName">
                       <input_name>position</input_name>
                   </action>                  
               </reference>
           </block>
       </block>
</test_adminhtml_test_customer>

This <input_name>position</input_name> is the name of your custom column

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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