js test
This commit is contained in:
@@ -339,7 +339,7 @@ function booking_manual_email_form($form, &$form_state, $input_option = "")
|
|||||||
|
|
||||||
$form['booking-email-default-ids'] = array (
|
$form['booking-email-default-ids'] = array (
|
||||||
'#type' => 'hidden',
|
'#type' => 'hidden',
|
||||||
'#value' => "",
|
'#value' => "[]",
|
||||||
'#prefix' => '<div id="booking_email_default_ids_wrapper">',
|
'#prefix' => '<div id="booking_email_default_ids_wrapper">',
|
||||||
'#suffix' => '</div>',
|
'#suffix' => '</div>',
|
||||||
'#attributes' => array('id' => 'booking_email_default_ids'),
|
'#attributes' => array('id' => 'booking_email_default_ids'),
|
||||||
@@ -490,12 +490,15 @@ function _booking_email_get_default_selection_callback($form, $form_state) {
|
|||||||
'#value' => drupal_json_encode($defaults),
|
'#value' => drupal_json_encode($defaults),
|
||||||
'#prefix' => '<div id="booking_email_default_ids_wrapper">',
|
'#prefix' => '<div id="booking_email_default_ids_wrapper">',
|
||||||
'#suffix' => '</div>',
|
'#suffix' => '</div>',
|
||||||
);
|
'#attributes' => array('id' => 'booking_email_default_ids'),
|
||||||
|
);
|
||||||
|
$output_html = render($replacementform_data['booking-email-default-ids']);
|
||||||
|
watchdog('booking_debug', "<pre>Manual Email ajax html\n@info</pre>", array('@info' => print_r( $output_html, true)));
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'#type' => 'ajax',
|
'#type' => 'ajax',
|
||||||
'#commands' => array(
|
'#commands' => array(
|
||||||
ajax_command_replace("#booking_email_default_ids_wrapper", render($replacementform_data['booking-email-default-ids'])),
|
ajax_command_replace("#booking_email_default_ids_wrapper", $output_html)),
|
||||||
array('command' => 'bookingEmailIDs'), // This will call the command nameOfCommand we just created in the JS file.
|
array('command' => 'bookingEmailIDs'), // This will call the command nameOfCommand we just created in the JS file.
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@@ -2,5 +2,6 @@
|
|||||||
* Special Effects AJAX framework command.
|
* Special Effects AJAX framework command.
|
||||||
*/
|
*/
|
||||||
Drupal.ajax.prototype.commands.bookingEmailIDs = function(ajax, response, status) {
|
Drupal.ajax.prototype.commands.bookingEmailIDs = function(ajax, response, status) {
|
||||||
alert("Hello I'm Maged Eladawy...") ; // this will be executed after the ajax call
|
var initValues = $.parseJSON($('input:hidden#booking_email_default_ids').val());
|
||||||
|
alert(initValues.first()) ; // this will be executed after the ajax call
|
||||||
}
|
}
|
Reference in New Issue
Block a user