The ‘id’ variable is not known when the button is created as it is related to a dropdown menu. I tried to set the ‘beforeSend’ function to modify the ‘id’ variable before the request is sent, but this seems impossible to do.
It seems like ‘data’ is used when i create the ajaxButton, much like how I did it before. What I need to do is modifying the content of the Ajax request when the button is clicked, before the request is sent.
The type and divId variables are appended to the Ajax request right when the button is created, but the function associated with the field data is called when the button is pushed. This makes it possible to append more varialbes to the request string after the button has been created.