0

when I try to add a class to the buttons in my dialog it pulls in other buttons. Code:

$("#selectAddressForm").dialog({
    title: "Please Select an option",
    buttons: [
              {
                  text: "Cancel",
                  "class" : "first-button",
                  click: function() {$(this).dialog('close');}
              }, 
              {
                  text: "Select",
                  "class" : "second-button",
                  click: function() {
                      bindCityStateDialog(cityState);
                      $(this).dialog('close');
                  }
              }
              ],
    resizable: false,
    width: 'auto',
});

When I run the code it adds in three extra buttons" find, findIndexOf, findByProperty. These are functions created in my ArrayUtils.js but I'm not even making any reference to them in the js file that I'm calling my dialog.

If it makes any difference I'm using jquery v1.4.2 and jquery-ui-1.8.6.

Thanks in advance, everyone.

simplyzeke
  • 62
  • 10

1 Answers1

0

This looks like a tough one.

I can't remember ever having used the class option. And I don't know if it really exists. I can, however, remember having used the icons option in a similar way you did. And it worked.

As you said, a custom method of yours may cause the problem. I would try and find out if this method is being called by printing out the stack trace. This might tell you if the suspected method is being called by the jQuery Dialog widget.

Community
  • 1
  • 1
StrubT
  • 998
  • 5
  • 18
  • I'll look into printing a stack trace. As it turns out it is another method causing the problem, but I'm not sure where. Also the class option works for me, I might be using a custom version of jquery-dialog though. For now I was able to hide extra buttons using CSS. – simplyzeke Nov 05 '14 at 16:35