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?
-
3magebase.com/magento-tutorials/…B00MER– B00MER2015年11月22日 21:25:22 +00:00Commented Nov 22, 2015 at 21:25
-
Did you get it? Maybe you can post your extension grid class to have a look?Denis Spalenza– Denis Spalenza2016年01月15日 16:05:34 +00:00Commented Jan 15, 2016 at 16:05
2 Answers 2
I just wanted to update this thread, as both links which are very useful, and would be very relevant to OpenMage, have expired. Here are the archive links:
This excellencemagentoblog.com (updated to archive link) 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