Theming ajaxified view/view block

Views module provides powerful end flexible tools to create custom template files for each element, but as it is using jQuery in few places, it is necessary to keep template structure in order, to make sure all JS and Ajax facilities will work correctly. This document describes relation between markup of Views and jQuery code which is attached to view which is using Ajax.

Creating custom Drupal.ajax object 'on the fly' and attach it to any DOM element on the page (div, td, span etc.)

Another title for this article to improve search results (thanks msypes):

Add AJAX capability to a new DOM element

From Drupal documentation we know how to add 'AJAX' for links and form element, from PHP with '#ajax' element attribute, but this technics propose to create AJAX object on client side.

To create new Drupal.ajax object we need to do the following:

Drupal AJAX Is No Longer Working

For some reason my
views, panels or any ajax feature
is not working on my drupal site

Can you please help?

Many Thanks

Taxonomy upgrade extras: 

collect form_states via ajax, if forms are in different blocks

I wonder if it's possible to get the values from two forms, if the forms are in two different blocks. I like to design a search page. The search page should have many option-forms for filtering the result. The search-page gets the xml-data from a solr-server, the option forms are sending users choice via REST to the solr-server. This works.

Taxonomy upgrade extras: 

need support, trying to implement ajax in a view

Hi, this is what im trying to do:

I made an inventory management, that was easy, I just did the content type product with its respective fields of cuantity, and others.
In a view I did 2 tables the normal stock and the critic stock, where I show the name of the product, the quantity and 2 buttons for each product, the button (+) and the button (-) those buttons are for add or remove products of the stock, you understand, this is an example

Taxonomy upgrade extras: 

9. Simple Drupal AJAX load with jQuery and delivery callback

Most of AJAX code in the Drupal documentation focus on traditional json/_get() applications, which require json manipulation on information on arrival at client side.

Using jQuery.load() function, with only a single line of JavaScript code you can load from an URL address HTML code that will render directly on target element on your site.

But the real trick here is to get only the piece of HTML you need instead of rendering a whole page with header, footer and every element that renders with your content.

Here is where a not well documented argument on hook_menu comes in action.

The 'delivery callback' function manipulates the hook_menu output by default using drupal_delivery_html() which returns a full HTML render page.

What we need to do is define our own delivery callback function returning just the HTML information we want to render via AJAX on client side.

The code will look like this:

1. Define a link to execute the AJAX call:
<a class="btn" href="#" onclick="myModule_ajax_load()">Ajax Test</a>


Subscribe with RSS Subscribe to RSS - ajax