I wonder, can I pass parameter from a dynamic created dijit button ?
function testcallfromDynamicButton (value) {
alert(value);
}
var thisButton = new dijit.form.Button({
label : thelineindex ,
id : "I_del_butt"+thelineindex,
name : "I_del_butt"+thelineindex,
onClick : testcallfromDynamicButton('test')
}).placeAt( thetabletd1 ) ;
Seems , this dosen't work, I tried to change to this. It works !!
function testcallfromDynamicButton () {
alert('test');
}
var thisButton = new dijit.form.Button({
label : thelineindex ,
id : "I_del_butt"+thelineindex,
name : "I_del_butt"+thelineindex,
onClick : testcallfromDynamicButton
}).placeAt( thetabletd1 ) ;
The question is , I want to let the function know, which button has been clicked (as all buttons are dynamically created, and the button id is generate by indexnumber), so I need to pass the button itself's id to the function. But passing parameter through onClick call seems not work in Dijit . How can I make it work ?