Does this module have the capability to add new nodes with AJAX? Editing with AJAX works, but the page always refreshes when I save a new node. Its really slow currently for users to add a list of nodes via editview, just as slow as through the regular interface. If we had a fast way to add nodes using AJAX that would be amazing. I apolagize if this feature has been implemented and this should be a support request or bug.

CommentFileSizeAuthor
#2 editview.newnodeajax.diff7.52 KBOliverColeman
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

OliverColeman’s picture

I need this for a job (I assumed editview already implemented this when I did the quote, dang...), so will make a patch.

OliverColeman’s picture

Status: Active » Needs review
FileSize
7.52 KB

Attached is a patch that implements this.

It includes code to re-render the view. To do this requires storing the view parameters and state (display, exposed filters, arguments, pager) in the form as hidden elements, and then reapplying them when rebuilding the view (the original view object can't be stored in a #value field because in some cases the form cache can be cleared). I've tested the display and arguments, but not the filter and pager stuff.

At the moment the JS slides the entire view up (hides it) until the new view is ready. I'm not entirely happy with this because most views take up a lot of space and so you can be left staring at who knows what while waiting for the request to complete. Perhaps it would be better to either slide just the new node form out (and then replace the entire view without any slides), or even just leave the view as is while waiting (just showing the throbber) and then replace it (no slides)?

Cheers,
Oliver

jason.fisher’s picture

thanks for the patch. reviewing several modules for a similar workflow, applied this patch to editview and will review the functionality combined..

Makku01’s picture

any news on this?

jason.fisher’s picture

We ended up using editablefield prior to testing this.

dreamer777’s picture

OliverColeman, thank you for patch.

I add the node with node reference field based on the argument in the view
All works fine, except that the new node is added to the wrong referenced node (actually the first one in the list), not the one based on the argument.

Where I can look to solve this bug?

Thank you.