Targeting Dialog Buttons

Targeting Dialog Buttons

How about we add a class to each generated dialog button:<div>
</div><div>ui-dialog-button-{lcase-text-of-the-button-spaces-replaced-with-hyphen}</div><div>
</div><div>So if you had</div><div>
</div><div>$("#myDiv").dialog({</div>
<div>  buttons: {</div><div>    "Ok": function() { ... },</div><div>    "Cancel": function() { ... }</div><div>  }</div><div>});</div><div>
</div><div>then you could target those buttons, whether you wanted to hide them, show them, disable them:</div>
<div>
</div><div>$(".ui-dialog-button-ok").hide();</div><div>
</div><div>$(".ui-dialog-button-cancel").attr("disabled", "disabled");</div><div>
</div><div>Currently you have to do this using the ordinal position and index of the button in the pane. Thoughts?</div>
<div>
</div><div>- Richard</div><div><span class="Apple-style-span" style="border-collapse: collapse; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><span class="Apple-style-span" style="border-collapse: separate; white-space: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px;">
</span></span></div>