2

I am very confuse How to Update the Editable Grid Data using Mass action.

I tried but it will got only Id in post. any one done this before then please guide me.

Please See the below Image If any one know the answer then let me know.

enter image description here

  • Maybe some you will find some info in the articles: stackoverflow.com/questions/8477792/…, stackoverflow.com/questions/5728842/… – Evgeni Ivanov Feb 8 '14 at 12:42
  • Buddy I already do that and editable filed come this is my local machine snap but when you select Action then How to fetch all this values my question is that – Keyul Shah Feb 8 '14 at 12:46
  • If you already receive the to-be-saved-data matched to the entity IDs in the POST/GET data, you can simply use a model-filter to fetch the appropriate entities and perform data-saves on them. I don't know what the POST/GET data of that editable grid is. – Elias Feb 8 '14 at 18:30
  • Buddy I am not satisfied with your answers. – Keyul Shah Feb 9 '14 at 5:10
  • Then provide more information. What data are you receiving already? – Elias Feb 9 '14 at 8:47
0

I cannot give you the direct answer but I definitely know the way.

For every admin grid magento creates javascript object varienGridMassaction. It is defined in \js\mage\adminhtml\grid.js.

During selecting checkboxes in grid, varienGridMassaction object saves ids of selected rows.

When you select mass action type and press Submit button you are not submitting form in normal meaning of this word. This button runs varienGridMassaction::apply(), which gets all selected ids and sends them with mass action type to the server.

So you cannot simply add inputs and make them be transferred with usual mass action data.

Possible solutions:

  • You can rewrite varienGridMassaction to send more data during submit.
  • Create one more button and javascript class to process your custom input fields.
  • @olekssi Can you guide me via code I am confused – Keyul Shah Feb 10 '14 at 9:59
  • So which solution you decided to start with? And what exactly code explanation you need? – oleksii.svarychevskyi Feb 10 '14 at 10:04
  • Second One Create the button and when we click on that button I want selected rows Editable values. – Keyul Shah Feb 10 '14 at 10:07
  • In grid container class add one more button using $this->_addButton(). Create controller which will process your ajax request. Create javascript function to get data from input fields from grid and send ajax request to your controller. During creating button specify onclick attribute with the name of your function. – oleksii.svarychevskyi Feb 10 '14 at 10:23
  • I can not add the Button using this $this->_addButton() if possible we can chat and solve my problem – Keyul Shah Feb 10 '14 at 12:15

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.