Ajax

Aus CavoxCms Wiki

Wechseln zu: Navigation, Suche

Jeder Ajax-Funktion kann als erster Parameter eine Callback-Funktion oder eine String-ID übergeben werden. Wird eine Callback-Funktion übergeben, wird beim Empfang des Resultats diese Aufgerufen mit dem Resultat als Parameter. Wird eine ID angegeben wird automatisch das Attribut des HTML-Elements mit der ID auf den Wert objekt.output gesetzt.

Inhaltsverzeichnis

cAjaxCall

function cAjaxCall(callback_or_id, html, html_params, cmd, cmd_params)

Parameter: ()

  • html = Funktionen: "module.function", "module:component.function", Views: "module" (component: main), "module:component", "module:component.controller.view", "module.controller.view" (component: main)
  • html_params = Array mit den Parametern (keine: null)
  • cmd = „module:command“
  • cmd_params: Array mit den Parametern (keine: null)

Beispiel (mit statischem Javascript-Array):

cAjaxCall("html_id", "mymodule:mycomponent:mycommand", "mymodule.funktion", null, {"param1": "abc", "param2": 5}); 

cAjaxCallForm

function cAjaxCallForm(callback_or_id, html, html_params, cmd, form_id)

form_id: id of the form, automatically get the cmd params from the form

cAjaxCallCmd

function cAjaxCallCmd(callbback_or_id, cmd, cmd_params)

See cAjaxCall without html output. Command can generate his own obj.output

TODO

Links

Persönliche Werkzeuge