Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

destroy and refresh #8

Closed
iamdenny opened this issue Jul 4, 2013 · 4 comments
Closed

destroy and refresh #8

iamdenny opened this issue Jul 4, 2013 · 4 comments

Comments

@iamdenny
Copy link

iamdenny commented Jul 4, 2013

I think there is no destroy and refresh method.
Can you please provide them?

@ajb
Copy link
Contributor

ajb commented Jul 4, 2013

Not documented, but they're in there: https://github.com/dobtco/jquery-resizable-columns/blob/gh-pages/coffee/jquery.resizableColumns.coffee

refresh = syncHandleWidths

@ajb ajb closed this as completed Jul 4, 2013
@cdaringe
Copy link

cdaringe commented Aug 4, 2014

What's the expected syntax to access, say, destroy? I couldn't access it after the fact without returning it. Any objection to returning the instances?

   return $.fn.extend({
     resizableColumns: function() {
-      var args, option;
+      var rcObjs = [],
+          args, option;
       option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
-      return this.each(function() {
+      this.each(function() {
         var $table, data;
         $table = $(this);
         data = $table.data('resizableColumns');
         if (!data) {
           $table.data('resizableColumns', (data = new ResizableColumns($table, option)));
+          rcObjs.push(data);
         }
         if (typeof option === 'string') {
           return data[option].apply(data, args);
         }
       });
+      return rcObjs;
     }
   });

@ajb
Copy link
Contributor

ajb commented Aug 4, 2014

Accessing the instance: $('table').data('resizableColumns')
Calling methods: $('table').resizableColumns('destroy')

Would love a PR that gets this into the README.

@pratik2pris
Copy link

var _resizableColumns = $("table").data('resizableColumns');
if (_resizableColumns) {
_resizableColumns.syncHandleWidths();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants