| | |
| | | }); |
| | | trC.on('click', function () { |
| | | that.changeRowColor($(this).attr('index')); |
| | | Table._onClick(e, i); |
| | | Table._onClick(e, i + (that._curPage - 1) * that._perPage); |
| | | }); |
| | | |
| | | if (this._onRow != undefined) { |
| | |
| | | }, |
| | | |
| | | changeRowColor(thisIndex) { |
| | | const index = thisIndex % this._perPage |
| | | const index = thisIndex % this._perPage; |
| | | if (this._lastSelectIndex != -1) { |
| | | $(`#row-${this._lastSelectIndex}`).css('background-color', ''); |
| | | } |
| | |
| | | const row = $(`#row-${index}`); |
| | | row.css('background-color', 'var(--select_color)'); |
| | | var tbody = $(this._table.find('tbody')[0]); |
| | | tbody.animate({ |
| | | tbody.animate( |
| | | { |
| | | scrollTop: row.outerHeight() * index - 350 + 'px', |
| | | }, 500); |
| | | }, |
| | | 500 |
| | | ); |
| | | // tbody.scrollTop(0, 100); |
| | | // this._table.scrollTop = 100 |
| | | }, |