Example i whipped up quick: http://jsbin.com/acucu/edit
On Nov 18, 2:05 pm, discern <cap...@gmail.com> wrote: > Because I am using the CLASS of the button to open UI Dialog (as > opposed to the ID), how can I pass it the ID (or any data, for that > matter)? I need to pass the ID of the button to dialog so I know which > row to apply the actions of the dialog to. > > var opt = { > autoOpen: false, > modal: true, > buttons: { > 'Show ID': function() { > alert("ID: "+id); // < I want to at least get this far > }, > Cancel: function() { > $(this).dialog('close'); > } > }, > > }; > > $("#new").dialog(opt); > > $('a.button').click(function() { // Because I am using CLASS not ID to > open UI Dialog (I have to; I am using this for several rows) > var id = $(this).attr('id').split('_')[1]; // This is the ID. How can > I pass it to UI Dialog? > $('#new').dialog('open'); > > });