asgallant,
Thanks for taking the time to look into this. I think I discovered a solution, although I'm still hazy about the reasons. I'm going to include a mock up of the non-working code and one of a working example. Hopefully this will help someone else down the road.
First: the context for my code is a custom app that displays records and lets the end user modify or delete them (using buttons). Depending on certain features of each record, different buttons are inserted into the row. For example, a read-only line might have a button for viewing details but not one for editing. To accomplish this, I render the Google Viz table and then loop through the table, inserting the buttons using jQuery.
After playing with it, I think I have an idea of what's going on, but I'm not sure I could explain it very precisely. In essence, the first example inserts all of the relevant HTML code and CSS classes, and the button comes out looking correct but lacking it's "button-ness." This means it does not have the appropriate mouse-over handling. In the second example, the HTML and CSS are inserted into the table, but the application of "button-ness" doesn't happen until after the table has been rendered. In this way, the jQuery UI .button() function is interacting with something that has already been added to the DOM.
------------------------------------------------------
Example 1: NOT WORKING - button code and .button() method from jQuery UI is used in the DataTable.setValue() function:
var btnDiv = $('<div></div>');
$(btnDiv).append(
$('<button id="myButton">Click</button>').button({
icons: {
primary: 'ui-icon-gear'
},
text: false
})
);
data.setValue(0, 0, $(btnDiv).html());
table.draw(view, {
allowHtml: true,
showRowNumber: true
});
Example 2: Functioning as expected. 1) Insert button HTML, 2) Render table, 3) Apply .button() method
var btnDiv = $('<div></div>');
$(btnDiv).append(
$('<button id="myButton">Click</button>')
);
data.setValue(0, 0, $(btnDiv).html());
table.draw(view, {
allowHtml: true,
showRowNumber: true
});
$('#myButton').button({
icons: {
primary: 'ui-icon-gear'
},
text: false
});