ludo / jquery-treetable

jQuery plugin to show a tree structure in a table
http://ludo.cubicphuse.nl/jquery-treetable
GNU General Public License v2.0
742 stars 277 forks source link

How to use test #206

Open abramhum opened 7 years ago

abramhum commented 7 years ago

Hi: I see a test file and see the jquery.treetable.test.js, but I dowesn,t know how to use it , is there any manual for that. And I meet a problem when tracing jquery treetable. I didn't see any jquery bind function, but when I click the arrow icon, it will invoke the method, like following: <span class="indenter" style="padding-left: 0px;"><a href="#" title="Expanding">&nbsp;</a></span>

And I see it call the function $.fn.treetable = function(method) { if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { return methods.init.apply(this, arguments); } else { return $.error("Method " + method + " does not exist on jQuery.treetable"); } };

Could you tell me how it work and why it work this way, any instructions is highly appreciated, thanks.