Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add post Promise functions #775

Open
wants to merge 3 commits into
base: 8.x-1.x
Choose a base branch
from

Conversation

jfcartier
Copy link
Contributor

Currently, there's a global postRender process and it works like a charm. But I think there's missing something; a postRender for Promises as a callback.

To justify this proposition, here's a case

Lets say we have an "AddToCalendar" link inside each views row.
So when we call theme_view, theres nothing we can do to add an event on each links.
Global postRender is of course triggered before the view query. If jQuery is installed, we could add the ".on()" function on body, but it's not really interesting since my solution solves that problem.

What do you think?

Currently, there's a global postRender process, it works like a charm, but I think there's missing something. A postRender for Promises, like a callback.

To justify this proposition, here's a case :

Lets say we have an "AddToCalendar" link inside each views row. 
So when we call theme_view, theres nothing we can do to add an event on each links.
Global postRender is of course triggered before the view query. We could add a jQuery ".on()" function on body, but it's not really interesting since my solution here solve that problem.

What do you think?
It could be useful to have the views results. We could want to manipulate something with data.attributes or even check what the view's output is to make something if its empty or not.
@jfcartier
Copy link
Contributor Author

Example of usage :

{
  _theme: 'view',
  _path: 'viewspath',
  _callback: [function(data){
    console.log(data);
  }],
  _row_callback: function(row) {
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant