defunkt/jquery-pjax — Issue #98: Add A Before Render Callback
Author: veganista
Created: 2012-02-24 13:03:55+00:00
State: open

I was looking at how to populate multiple areas using pjax and noticed this post where you say you dont want to over complicate pjax.

https://github.com/defunkt/jquery-pjax/pull/7

I think it would be beneficial to have a callback that could be called just before pjax updates the container. This would allow users to do any pre-processing of data they needed (probably not a requirement but could be useful to some) and importantly would allow users to update multiple places.

From what i have created its a very simple change and uses the event system already being used.

My current implementation only updates the container if the beforeRender callback returns true, although this could be changed to return the content if the pre-processing feature mentioned above might be of use.

If your interested i can tidy up the code a bit more and do some more testing.