[support] Unique identifier

Chris Miller cjm at tryx.org
Thu Oct 31 19:44:57 UTC 2013


Hi Folks, 

Is there any unique identifier associated with a re-written link field in a view? 

Context for the above question: AJAX is dead simple for links. There are four steps: 


    1. call hook_menu to establish two paths and the attendant callbacks <path-ante>/nojs/<path-post> and <path-ante>/ajax/<path-post> 
    2. re-write the path to include "/nojs" somewhere 
    3. tag the relevant links with "class=use-ajax" 
    4. include the line "drupal_add_library('system', 'drupal.ajax');" in the page. 

Here's the problem. When I receive the AJAX post in the callback for the path <path-ante>/ajax/<path-post>, I have to respond with the new HTML and a jQuery selector to indicate the "target" of my AJAX updates to the DOM. Since I don't know the DOM node that is calling me, I don't know how to tell the browser to select it. If there were some unique identifier, then when I re-write the link I can add this to the custom css classes that also are included with the re-write. 

Chris. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20131031/b376025e/attachment.html 


More information about the support mailing list