Hi,
I've looked around for some info already, but just in case I've missed something -- does anyone know of any good resources for integrating jQuery into Views in Drupal 7? I've seen the dataTables plugin, which seems not to work correctly for me with Views (it doesn't look like it's finding some of the style information, and, in views preview mode, it seems to loop through the result of the view three times, so there will be three pagers and three of some of the other elements as well -- obviously something isn't configured correctly, but I can't figure it out yet). Also, I'd like to know if there is a good way to use a lightbox with a data table -- basically, I have a table view of some nodes and only a few of the fields for a certain content type, but I'd like the user to be able to click on a row to see the rest of the fields included with that content type, but have the 'node view' come up in a lightbox instead of having to load a new page.
I'm fairly comfortable with jQuery outside of Drupal, but just not sure how to approach this with Drupal 7 and Views 3. I'm definitely appreciative of any info or pointers. I'd love to have something that looks fresh/web 2.0, and I'd love to be able to use some of the capabilities of jQuery.
Thanks!
Jonathan
Comments
jQuery 1.4.4 is already
jQuery 1.4.4 is already standard with Drupal and Views uses it, so you shouldn't need any resources for integrating them. You may want to look at the jQuery Update module (http://drupal.org/project/jquery_update) if you need a jQuery version newer than 1.4.4.
All that being said, there's very little need for the dataTables jQuery plugin because Views provides all the functionality for tabular layout, paging, exposed filters and sorting by columns. I think the only feature in dataTables that Views does not offer out of the box is the ability for end users to select how many results they want to view per page... but that could easily be done by performing a form alter to add the number selector to the exposed filters, then using the number to adjust the view object's results per page in hook_views_pre_build().
As for the lightbox effect, Drupal 7 core includes the "overlay" module, which provides the lightbox effect for admin pages. There are a few modules available that appear to extend the overlay for non-admin page use (e.g. http://drupal.org/project/context_overlay), but I don't have experience with any so I can't recommend one.