iview / iview-project

This project is build for Vue.js 2 + vue-router + webpack2 + iView 3
MIT License
838 stars 390 forks source link

Expanded table opened by default #32

Open agungjk opened 7 years ago

agungjk commented 7 years ago

How to set expanded table open by default? i found this params "_expanded: true", but don't know where it must be placed

reference : "给行数据 data 的某项设置 _expanded 为 true,可以默认展开当前行,设置 _disableExpand 可以禁用当前行的展开功能。 渲染展开区域与自定义列模板方法类似,使用 render 函数。当内容较复杂时,可拆分为组件或使用 JSX。"

shishir99111 commented 6 years ago

Facing the same issue!.. https://www.iviewui.com/components/table-en#Expandable following the link mentioned from documentation

shishir99111 commented 6 years ago

Got the solution, After looking at the source code of iview (link) you just have to insert "_expanded: true" in data object targeting the row, which you want to expand if you follow this fiddle (taken from the official documentation), you have to insert "_expanded: true" inside data[0] , if you want to expand first row.