Development

dgDojoPlugin/DojoHelpers (diff)

You must first sign up to be able to contribute.

Changes between Version 12 and Version 13 of dgDojoPlugin/DojoHelpers

Show
Ignore:
Author:
Dean.Glazeski (IP: 68.225.171.15)
Timestamp:
07/14/08 02:27:28 (9 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • dgDojoPlugin/DojoHelpers

    v12 v13  
    464464<?php echo dojo_button_to_function('Remove Updates', dojo_update_element('stuff', array('action' => 'remove'))) ?> 
    465465}}} 
     466 
     467== dojo_observe_field == 
     468 
     469Creates Javascript to watch a field for a specific event.  It then does an XMLHttpRequest to a server with the current value of the field.  This function can connect to any event you need it to, but it defaults to the 'onchange' event. 
     470 
     471=== Arguments === 
     472 1. The field ID of the field to watch 
     473 1. Options for the remote function 
     474 
     475==== Field ID ==== 
     476 
     477This can be any valid field ID in the current page. 
     478 
     479==== Remote Function Options ==== 
     480 
     481See [wiki:dgDojoPlugin/DojoHelpers#Options Dojo Remote Function] for information on these options. Some options are modified, though.   
     482 1. with - Adds the value of the field to the with parameters 
     483 
     484There are some additional options that are not used by the remote function. 
     485 1. frequency - If set and greater than zero, the observer will trigger every 'frequency' seconds 
     486 1. event - What Javascript event to have the observer trigger on, default is 'onchange' 
     487 
     488=== Return === 
     489 
     490Returns a Javascript tag with all of the Javascript to execute the desired action. 
     491 
     492=== Examples === 
     493 
     494{{{ 
     495#!php 
     496// observe the name field 'onchange' which is triggered after the input looses focus 
     497<?php echo dojo_observe_field('name', array('url' => '@homepage',  
     498                                            'timeout' => 2000, 
     499                                            'update' => array('success' => 'stuff', 'failure' => 'locale'), 
     500                                            'renderWidgets' => true, 
     501                                            'position' => 'bottom', 
     502                                            )) ?> 
     503}}}