使用 jQuery treeTable 进行延迟加载
我正在使用这个插件来获取树视图表:http://ludo。 cubicphuse.nl/jquery-plugins/treeTable/doc/
它工作得很好,除了我需要的一件事,那就是内容的延迟加载。
它确实提供了打开文件夹时的回调功能,然后我用它来获取新打开的分支并使用 ajax 调用来填充数据。它可以很好地填充表格,但添加的行不符合应有的缩进结构。
调用 jQuery('#tree-table').treeTable({});添加额外的行后会导致正确的缩进,但它也会折叠树,这对于用户沿着较深的路径导航来说很烦人。
有没有其他人尝试过对 treeTable 做类似的事情?
I'm using this plugin to get a tree-view table: http://ludo.cubicphuse.nl/jquery-plugins/treeTable/doc/
It works great, except for one thing that I need, which is lazy loading of content.
It does provie a callback feature for when a folder is opened, which I then use to fetch the freshly opened branch and use an ajax call to populate it with data. It works great filling in the table, but the added rows don't conform to the indented structure they should.
A call to jQuery('#tree-table').treeTable({}); after the additional rows are added results in proper indentation, but it also collapses the tree, which is annoying to user navigating down a deep path.
Has anyone else attempted to do anything similar with treeTable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
GitHub 上有一个关于延迟加载的问题,可能会有所帮助: https://github.com /ludo/jquery-treetable/issues/24
There is an issue on GitHub concerning Lazy Loading, that might help: https://github.com/ludo/jquery-treetable/issues/24
看起来您会想要使用:
他们在 API 中提供的功能。添加新分支后,请确保保存对其的引用,然后在重新初始化后调用一个函数以使其显示(在本例中可能是reveal())。
it looks like you will want to use either:
functions which they offer in their API. Once you add the new branch, make sure you save a reference to it, and then after you re-initialize then call a function to get it to show (probably reveal() in this case).