|
177 | 177 | return; |
178 | 178 | } |
179 | 179 | if (arguments[0] === 'post-header') { |
180 | | - if (!this.$fixedColumns && !this.$fixedColumnsRight) { |
181 | | - this.initFixedContainer(); |
182 | | - } |
183 | 180 | this.initFixedColumnsHeader(); |
184 | 181 | } else if (arguments[0] === 'scroll-body') { |
185 | 182 | if (this.needFixedColumns && this.options.fixedNumber) { |
|
385 | 382 | //给鼠标滑轮绑定事件 |
386 | 383 | updateScroll(e, that.$fixedBody[0]); |
387 | 384 | }); |
| 385 | + //给固定表格的checkbox绑定事件 |
| 386 | + this.$fixedBody.find('input[name="' + this.options.selectItemName + '"]').off("click").on('click', function (e) { |
| 387 | + e.stopImmediatePropagation(); |
| 388 | + var index = $(e.target).data("index"); |
| 389 | + $(that.$selectItem[index]).trigger("click"); |
| 390 | + }); |
| 391 | + //绑定TD点击事件 |
| 392 | + this.$fixedBody.find('> table > tbody > tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) { |
| 393 | + var index = $(this).closest("tr[data-index]").data("index"); |
| 394 | + $(that.$selectItem[index]).closest("tr[data-index]").find(">td:eq(" + $(this).index() + ")").trigger("click"); |
| 395 | + }); |
388 | 396 | } |
389 | 397 | //给原本表格绑定scroll事件 |
390 | 398 | $('div.fixed-table-body').off('scroll'); //给所有的body解绑 scroll |
|
416 | 424 | updateScroll(e, that.$fixedBodyRight[0]); |
417 | 425 | }); |
418 | 426 | //给固定表格的checkbox绑定事件 |
419 | | - this.$fixedBody && this.$fixedBody.find('input[name="' + this.options.selectItemName + '"]').off("click").on('click', function (e) { |
| 427 | + this.$fixedBodyRight.find('input[name="' + this.options.selectItemName + '"]').off("click").on('click', function (e) { |
420 | 428 | e.stopImmediatePropagation(); |
421 | 429 | var index = $(e.target).data("index"); |
422 | 430 | $(that.$selectItem[index]).trigger("click"); |
423 | 431 | }); |
| 432 | + //绑定TD点击事件 |
| 433 | + this.$fixedBodyRight.find('> table > tbody > tr[data-index] > td').off('click dblclick').on('click dblclick', function (e) { |
| 434 | + var index = $(this).closest("tr[data-index]").data("index"); |
| 435 | + $(that.$selectItem[index]).closest("tr[data-index]").find(">td:eq(" + $(this).index() + ")").trigger("click"); |
| 436 | + }); |
424 | 437 | } |
425 | 438 |
|
426 | 439 | if (this.options.filterControl) { |
|
0 commit comments