开发者

How to trap the expand event in jQuery treetable

I'm using the treetable plugin in my web app. http://plugins.jquery.com/project/treeTable

I want to be able to perform an action when a specific expandable node is expanded.

I can determine which element is responsible for expanding the node. Its a span with class expander. As far as I can tell the plugin doesnt have an event that is fired when the node is expanded or toggled.

I think this is more of a jquery question than a treetable question, b开发者_C百科ut how would I go about doing that.


Because there is no event, what you could do is replace $.fn.expand with your own function that performs the logic you need it to do, and then executes the original $.fn.expand function. E.g.

var originalExpand = $.fn.expand;
$.fn.expand = function(){
  // Do something
  originalExpand.apply(this, arguments);
};

That is a crude example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜