Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#7680 closed bug (notabug)

dialog bottons error up in ui.buttion.min.js --->Error: this.element.propAttr is not a function

Reported by: akpalmer Owned by: akpalmer
Priority: minor Milestone: 1.9.0
Component: ui.button Version: 1.8.15
Keywords: Cc:
Blocked by: Blocking:

Description

I was working with a dialog box trying to add a OK button. when i refresh the page and clicked the button that was supposed to open the dialog box, i got this error

this.element.propAttr is not a function

I changed the ui.buttion.min.js to the unminifed version and it started working.

here is part of my code.

function textopen(data){

$( "#dialog-modal" ).dialog({

height: 400, width:500, modal: true, buttons: {

Ok: function() {

$(this).dialog( "close" );

}

}

}); $( "#dialog-modal" ).html('<span><textarea id="hoverText" class="text ui-widget-content ui-corner-all" >' + data + '</textarea></span>');

}

Change History (4)

comment:1 Changed 12 years ago by Scott González

Owner: set to akpalmer
Status: newpending

Sounds like you're mixing versions. If you continue having problems, please provide a reduced test case.

comment:2 Changed 12 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

comment:3 in reply to:  2 Changed 12 years ago by lauhub

Replying to trac-o-bot:

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

I do not agree with this. I had to correct myself the bug (which is due to a function name change from propAttr to attr).

Here are the corrections to do below: Into jquery.ui.button.js:

  1. replace:

this.options.disabled = this.element.propAttr( "disabled" ); with this.options.disabled = this.element.attr( "disabled" );

2.replace: this.element.propAttr( "disabled", true ); with this.element.attr( "disabled", true );

  1. replace:

this.element.propAttr( "disabled", false ); with this.element.attr( "disabled", false );

This work fine for me but I could not make further testing since I am in a hurry on my own project

comment:4 Changed 11 years ago by markli

This issue happened in my local server, it said "Uncaught TypeError: Object [object Object] has no method 'propAttr'" under Chrome. Then I updated the js file named "jquery.ui.button.js" :

line 59:

if (this.element.attr("disabled")) {

this.options.disabled = true;

} else {

this.options.disabled = false;

}

line 279: this.element.attr( "disabled", true );

line 281: this.element.attr( "disabled", false );

Then it works well.

Note: See TracTickets for help on using tickets.