ASP.NET ZERO 学习 JTable的使用子表闭合功能
双击子表自动判定开闭功能
//CHILD TABLE DEFINITION FOR "PHONE NUMBERS" Phones: { title: '', width: '5%', sorting: false, edit: false, create: false, display: function (studentData) { var $img = $('<img src="/Content/images/Misc/phone.png" title="Edit phone numbers" />'), //Create an image that will be used to open child table parentTable = $("#StudentTableContainer"); //Open | Close child table when user clicks the image $img.click(function(){ var tr = $(this).parents("tr"), isChildRowOpen = parentTable.jtable("isChildRowOpen", tr ); if( isChildRowOpen ){ $( parentTable.jtable("getChildRow", tr ) ).slideUp(); return; } // some another code } } }
作者:Joe.Fan
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。