I don’t know if it is an easy question but i couldn’t find the solution. I want to create 10 buttons in dojo like the button below.
<div style="right: 1px">
<button data-dojo-type="dijit.form.Button" id="SaveChangesDataGrid1" onclick="SaveChanges()">
Save</button>
</div>
but each button with different ID but the same function onClick. so what i want is when the button is clicked the id of the clicked button will be known in the function.
I am using dojo 1.8 any ideas?.
Change your
onclick="SaveChanges()"toonclick="SaveChanges(event)"or get rid of it and usedata-dojo-props:Start your
SaveChanges()this way to getid:
See it in action at jsFiddle: http://jsfiddle.net/phusick/WfdKF/