1

Could we add a select list in a view content?

I have below view and I want to add a select list that has (Approve and Reject items) for each row under 'Status' column. Also, there will be a 'Save' button to save the changes in database.

enter image description here

Can we do this in view or there is another way? Please help..

3
  • You can take global php variable in the fields section in your views and in that provide two links one with the name approve and another with the name reject and define custom menu for each link in hook_menu and define the menu callbacks for them where you can programmatically save the content. May 22, 2017 at 6:21
  • Thank you for your replay. If I add this to global php <a href='URL'>More Info...</a> what is the URL that I have to add it?? May 23, 2017 at 9:42
  • hook_menu.. Can I alter the view module? May 23, 2017 at 9:43

1 Answer 1

0

Please read post Programmatically Creating Forms with Views in Drupal 7 which is very close to your requirement.

2
  • Thank you for your replay. It is a useful link but they use a custom module.. Can I customize view module by using this function 'views_views_pre_view(&$view, &$display_id, &$args)' ?? May 23, 2017 at 9:45
  • Hacking a contributed module is not allowed in Drupal because you don't know your code may break the default functionality of the module or some dependent module. Instead hacking contributed module you can write custom field handler in your custom module. May 23, 2017 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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