Search and Top Navigation
#7680 closed bug (notabug)
Opened August 30, 2011 11:13AM UTC
Closed September 14, 2011 08:11AM UTC
Last modified December 27, 2011 05:16PM UTC
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>');
}
Attachments (0)
Change History (4)
Changed August 30, 2011 11:40AM UTC by comment:1
owner: | → akpalmer |
---|---|
status: | new → pending |
Changed September 14, 2011 08:11AM UTC by comment:2
resolution: | → invalid |
---|---|
status: | pending → closed |
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!
Changed September 15, 2011 04:37PM UTC by comment:3
Replying to [comment:2 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 );
3. 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
Changed December 27, 2011 05:16PM UTC by comment:4
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.
Sounds like you're mixing versions. If you continue having problems, please provide a reduced test case.