亮点: each(function(i)) ,i 就是每一行的序号,从0开始
点击(此处)折叠或打开
- <script type="text/javascript">
- $(function(){
- $("#table1 tr").each(function(i){
- $(this).click(function(){
- alert("你点击的是第"+(i+1)+"行");
- });
- });
- });
- </script>
点击(此处)折叠或打开
- function getSelectedRow() {
- var rowselect = [];
- $table.find('tr.selected').each(function () {
- var val = $(this).data('index');
- var rowvalue = $table.bootstrapTable('getData')[val].case_id;
- rowselect.push(rowvalue);
- });
- return rowselect;
- }