New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Allow to provide custom table-body implementation #14471
Comments
By the way, I can create a PR for the 2nd solution if you like it |
Why not add infinite scrolling feature to |
Better to add an extension point. I want to track pages using IntersectionObserver, somebody else will want to implement virtual scrolling (reusing DOM elements) and so on. That’s why I suggest to reuse existing functionality with an ability to make something custom. |
got it , Would you like provide an simple implement? |
Sure, I’ll be able start working on 2nd approach either on this weekend or the next |
Thank you. |
Any updates here? |
Haven’t had time to work on this. Plan to do it this weekend |
Take your time, please. |
After thinking about implementation details, I found out that it's much easier to implement 1st option. It can be done like this: import Table from 'element-ui/lib/table'
import MyTableBody from './MyTableBody.vue'
export default {
name: 'MyTable',
extends: Table,
components: {
TableBody: MyTableBody
}
} The same can be done to any part of
@iamkun @island205 are you ok with that approach? |
is it possible to |
@stalniy modify https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.en-US.md#prerequisites |
That works. Bu the question is about examples/docs/table.md file. I’m trying to use |
We do not support |
I see. Created PR without updates to documentation. |
@stalniy we will check your PR soon. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Existing Component
Yes
Component Name
el-table
Description
I want to implement infinite scrolling by using el-table component and track visible page with IntersectionObserver API.
For example, each page contains 50 elements. I want to group 50
<tr>
tags inside one<tbody>
. In such way, each tbody contains elements for a single page. Then I can track when one tbody appears and another disappears to track when to switchpage
parameter in browser url.Currently I can do this by overwriting
Table.components.TableBody
but this is a hacky solution.So, there are several ways to fix this:
Table
'srender
function into several smaller functions (e.g.,renderBody
,renderFooter
, etc). So, then I can extend component and overload that functions:The text was updated successfully, but these errors were encountered: