Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Zoho Docs
Google Docs
Each Attachment size should not exceed 1MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Screen name:
kennardconsulting
kennardconsulting's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Ideas
Problems
Expanded view
List view
Private Message
How to access JavaScript object that WidgetFactory instantiates
[2Replies]
03-Jan-2013 12:14 AM
Forum:
Using jQuery UI
Hi guys,
Thanks for all the great work you do on JQuery UI!
I'm trying to access the JavaScript object that WidgetFactory instantiates and wraps around my DOM element. I tried:
1. Calling my widget method with no args, but that returns the DOM element
2. Calling
http://api.jqueryui.com/jQuery.widget/#method-widget
but that returns the DOM element
3. Adding a new method 'returnThis' but JQuery appears to mangle that somehow? See code below, and fiddle here:
http://jsfiddle.net/MfegM/521
I've found I can return 'this' if I wrap it in an array, and then JQuery does not mangle it. But presumably there is a proper way to do this?
--- JavaScript code ---
$.widget( "custom.returnThis", {
getThis: function() {
console.log( "Inside here, 'this' is" );
console.log( this );
return this;
},
} );
$( '#returnThis' ).returnThis();
var returned = $( '#returnThis' ).returnThis( "getThis" );
console.log( "But outside, 'this' becomes" );
console.log( returned );
«Prev
Next »
Moderate user : kennardconsulting
Forum