Passing object/information to Dialog button function/event
How can I pass information or objects to the function which is executed when a button in a UI dialog is clicked?
My page displays collections of records which originate from JSON and clicking those records will pop up a dialog to edit the records. When the save button in the dialog is clicked I need to update the correct JSON object. To do this I'm looking for a way, how to know about the right object in the click function of the save button.
Any idea how to do this?
For modal dialogs, it would be feasible (but ugly) to put a reference to the right object in a global variable. If the dialogs are not modal or more than one dialog can be opend at a time this approach is not working so well.
I've been Googling for a while on this topic, but never found a reasonable solution.