September 14, 2014
The concrete5 Page Selector helper includes optional parameters to run your own JavaScript. But what if you need to run the original helper JavaScript followed by your own JavaScript?
$pageSelector = Loader::helper('form/page_selector');
Rather than use the parameters built in to the php of the concrete5 helper, you can subvert the global function that it uses (within a jQuery ready handler):
var redirect_old_handler = ccm_selectSitemapNode;
var redirect_new_handler = function(cID, cName) {
redirect_old_handler (cID, cName);
/*
your stuff here to do things with cID and cName
*/
};
ccm_selectSitemapNode = redirect_new_handler;
What this code does is to simply:
Make a note of the existing handler
Define a new handler that calls the old handler
Replace the existing handler with the new handler
Similar techniques can be used to work with the result of other concrete5 form widgets.
Loading Conversation
Related Tutorials
- 9
- 0
December 11, 2012
- 8
- 0
September 08, 2013
- 8
- 0
November 01, 2011
- 6
- 0
November 03, 2011
- 21
- 0
February 23, 2012
- 10
- 0
May 29, 2013
- 10
- 0
July 19, 2009
- 4
- 0
August 03, 2009
- 11
- 0
August 04, 2012
- 11
- 0
September 16, 2011
- 3
- 0
April 02, 2014
- 8
- 0
May 14, 2011
- 26
- 0
January 20, 2011
- 2
- 0
February 25, 2011
- 14
- 0
February 24, 2012
- 10
- 0
November 02, 2011
- 5
- 0
September 28, 2013
- 28
- 0
May 20, 2010
- 6
- 0
August 05, 2014
- 15
- 0
April 17, 2011
- 6
- 0
November 09, 2011
- 3
- 0
February 17, 2014
- 15
- 0
February 26, 2012
- 3
- 0
June 09, 2010
- 8
- 0
October 31, 2011
- 6
- 0
July 08, 2012
- 6
- 0
June 22, 2013
- 6
- 0
November 07, 2011
- 8
- 0
October 27, 2011
- 8
- 0
June 16, 2012
- 7
- 0
December 31, 2012