Hello!
Newbie question:
I'm trying to create an instance from another library on "_create" and the access this from private and public functions in my widget. Is this possible?
- $.widget('namespace.pluginName', {
- _create: function() {
-
- // Create instance from other library on create
- var someovar = otherlibrary.function(options);
- },
- _privatemethod: function() {
- var self = this;
- // Call "samovar" instance?
- self._create.somevar.function( "option", function() {
- // Do sutff
- });
- }
- }));
I also like to cache my selections only once like this: var div = $('#my_div'); on _create. Right now I need to reselecting the same div on 10 different function. Is this the way to do it or should I just ignore the caching?
Thanks!
/Andreas