I have a function which creates a dialog filled with buttons, whose names come from a button array. See this post here.
What I would like to do is modify this function such that I can apply styles to the button array generated. As such...
function setAutoDialog(){
var testArray = ["T1", "T2"];
var testFunction = function () {
alert("worked");
}
var myButtons = {};
for(var i = 0; i < testArray.length; i++){
myButtons[testArray[i]] = testFunction;
}
for(var i = 0; i < testArray.length; i++){
myButtons[i].css('background','black');
}
$('#autoDialog').dialog({
autoOpen: false,
width: 'auto',
buttons : myButtons
});
}
As some of you might suggest, I just can't apply a class to the button because the colors will be set by the user, or come from an array of ordered colors to match said button. Any help with this would be much appreciated.