How to push values from views attachment to Javascript?

by Jed_BH   Last Updated May 16, 2019 02:07 AM

I have a table view with both filters and exposed filters, and attached to it there is another view that uses views_aggregator_plus to display a summary of months and different value counts.

I want to have the attachment visualized so I attached ChartJs script to the page view and had another function loop through the attachment html table rows to fetch the data while separating each column into its own array.

This works though I am not sure. It doesn't feel right. Wouldn't it be better if I pushed the values from the view directly to the script rather than have it done by the browser?

I am not sure about how to do it, but I found the values needed in hook_view_post_render under $view->style_plugin->rendered_fields..

How to proceed from there? Or maybe there is an entirely different and better way to achieve the same?


Tags : views 8 charts

Related Questions

Updated July 13, 2015 14:03 PM

Updated June 29, 2015 15:03 PM

Updated May 14, 2015 16:03 PM

Updated April 04, 2015 15:03 PM