Thanks for your reply, please excuse my late reaction.
Callbacks I already use. What I would like to achieve is to return a value from the backend to the script. Unfortunately it is not visible how I can do that with ExecuteAjaxEvent.
It is important to return to the caller as I cannot initiate the rest of the function from within the Delphi part, especially if it is an attached anonymous function.
An other example would be to callback into the Backend on rightclick, get configuration for am menu from the backend then continue displaying that menu in JavaScript.
Callbacks I already use. What I would like to achieve is to return a value from the backend to the script. Unfortunately it is not visible how I can do that with ExecuteAjaxEvent.
It is important to return to the caller as I cannot initiate the rest of the function from within the Delphi part, especially if it is an attached anonymous function.
An other example would be to callback into the Backend on rightclick, get configuration for am menu from the backend then continue displaying that menu in JavaScript.
Code:
$(this).on("contextmenu", function (e) {
// return native menu if pressing control
if (e.ctrlKey) return;
//open menu
var wurst = executeAjaxEvent("&id="+curID, null,"#{%htmlname%}.OnMenuCallback",
false, null, false);
var $menu = $(settings.menuSelector)
.data("invokedOn", $(e.target))
.show()
.css({
position: "absolute",
left: getMenuPosition(e.clientX, 'width', 'scrollLeft'),
top: getMenuPosition(e.clientY, 'height', 'scrollTop')
})
... 
