A common UI is to have a table of data rows, which when clicked on expand to show a detailed breakdown of “child” rows below the “parent” row.
The only requirements are:
Put a class of “parent” on each parent row (tr)
Give each parent row (tr) an id
Give each child row a class of “child-ID” where ID is the id of the parent tr that it belongs to
Example Code
$(function() {
$(‘tr.parent’)
.css(“cursor”,”pointer”)
.attr(“title”,”Click to expand/collapse”)
.click(function(){
$(this).siblings(‘.child-‘+this.id).toggle();
});
$(‘tr[@class^=child-]’).hide().children(‘td’);
});Example Table (click a row)
ID | Name | Total | |
---|---|---|---|
123 | Bill Gates | 100 | |
2007-01-02 | A short description | 15 | |
2007-02-03 | Another description | 45 | |
2007-03-04 | More Stuff | 40 | |
456 | Bill Brasky | 50 | |
2007-01-02 | A short description | 10 | |
2007-02-03 | Another description | 20 | |
2007-03-04 | More Stuff | 20 | |
789 | Phil Upspace | 75 | |
2007-01-02 | A short description | 33 | |
2007-02-03 | Another description | 22 | |
2007-03-04 | More Stuff | 20 |
以上就是【Expandable “Detail” Table Rows】的全部内容了,欢迎留言评论进行交流!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
8. 精力有限,不少源码未能详细测试(解密),不能分辨部分源码是病毒还是误报,所以没有进行任何修改,大家使用前请进行甄别
丞旭猿论坛
暂无评论内容