X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FClientJS.pm;h=96132cfb387fa816e95d1dd6cc803cb4a6207e1a;hb=d8ac08282dad52789b8bea785e8cddae44085483;hp=d58905e75986cb90178a56a7f3a6a30d3164dc0e;hpb=2738c03e1340255baade2fd357aafbbfd1347d5e;p=kivitendo-erp.git diff --git a/SL/ClientJS.pm b/SL/ClientJS.pm index d58905e75..96132cfb3 100644 --- a/SL/ClientJS.pm +++ b/SL/ClientJS.pm @@ -14,7 +14,7 @@ use Rose::Object::MakeMethods::Generic my %supported_methods = ( # ## Non-jQuery methods ## - flash => 2, # display_flash(, ) + flash => 2, # kivi.display_flash(, ) # ## jQuery basics ## @@ -70,6 +70,11 @@ my %supported_methods = ( # Form Events focus => 1, + # ## jqModal plugin ## + + # Closing and removing the popup + jqmClose => 1, + # ## jstree plugin ## pattern: $.jstree._reference($()).() # Operations on the whole tree @@ -212,12 +217,12 @@ with jQuery First some JavaScript code: // In the client generate an AJAX request whose 'success' handler - // calls "eval_json_response(data)": + // calls "eval_json_result(data)": var data = { action: "SomeController/the_action", id: $('#some_input_field').val() }; - $.post("controller.pl", data, eval_json_response); + $.post("controller.pl", data, eval_json_result); Now some Perl code: @@ -273,7 +278,7 @@ There are three things that need to be done for this to work: =item 1. The "client_js.js" has to be loaded before the AJAX request is started. -=item 2. The client code needs to call C with the result returned from the server. +=item 2. The client code needs to call C with the result returned from the server. =item 3. The server must use this module. @@ -392,8 +397,8 @@ But it is easier to integrate into a method call chain, e.g.: Display a C<$message> in the flash of type C<$type>. Multiple calls of C on the same C<$self> will be merged by type. -On the client side the flash of this type will be cleared before the -message is shown. +On the client side the flashes of all types will be cleared after each +successful ClientJS call that did not end with C<$js-Eerror(...)>. =item C