I have the following problem. I'm trying to add dynamic buttons in a modal dialog. But I don´t know, how I can give the function to each button.
I have the following:
for(i=0;i<buttons.length;i++){
arrButton[i] = { id : buttons[i].name , text : buttons[i].label , click : function(){ buttons[i].onclick } };
}
$("#divFormulario").dialog
({ modal : true,
title : titulo,
resizable: false,
buttons : arrButton
});
For example, if I have the following : buttons[i].onclick = "functionAlert();, when I create the button have the click event with buttons[i].onclick, but I need the click event with functionAlert(). What am I doing wrong?