如何创建在表行下方出现的div [英] How to create a div that apears below a table row

查看:92
本文介绍了如何创建在表行下方出现的div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

就像这个演示

http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx

除了在此演示中,它被添加为附加行. (单击>"之一并检查页面源,它​​在表中添加了新行).如果使用此策略,将很难使用标准的Jquery插件(如表排序器)进行排序.

Except In this demo it's being added as an additional row. (click one of the ">" things and check the page source, it added a new row to the table). If I used this strategy, It would be difficult to sort, using a standard Jquery plugin, like table sorter.

想法?

推荐答案

走了一下,对我的评论进行了一些思考,关于找到行高并覆盖div.也许有人可以帮忙整理一下

went away and did some thinking about my comment, about finding row height and overlaying the div.. it's so close, but I'm no jQuery whiz, so perhaps someone can help tidy this up

如果在打开下一个div/行之前关闭div/行,我会在正确的位置显示/隐藏div.但是,如果在打开div的同时单击按钮2不会得到正确的位置(它得到的行是展开后的位置,而不是原始行的位置),我确定必须有一种方法可以在不展开行并将其存储的同时获取该位置??

I have it showing/hiding the div in the right position IF the div/row is closed before the next one is opened.. but if you click button 2 while div one is opened is doesn't get the right top position (it gets the position the row was at after being expanded not the original row position), I'm sure there must be a way to get that position while the rows are not expanded and store it??

无论如何,..我知道这是一个漫长的,可变的明智的选择,因为我只能应用CSS逻辑-我对js或jquery函数以及存储还不了解.我怎么知道我的变量以及需要哪些变量,这可能会帮助那些确实知道如何使它变得更好的人;)

anyway have at it.. I know it's very long-winded, variable wise, because I can only apply the CSS logic - I don't know enough about js or jquery functions and storing.. also I thought if I explained how I got to my variables and which ones were needed it might help those who do know how to make this better ;)

  • 输入/按钮没有文本,但它们是单击触发器

  • the input/buttons have no text but they're the click trigger

position()可能不是正确的选择,它需要div才能找到相关行的原始位置(在table-wrap div内部?)

position() is maybe not the right thing to use, it needs for the div to be able to find the original position of the related row (inside table-wrap div?)

?

这篇关于如何创建在表行下方出现的div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆