Open David-TechNomad opened 5 months ago
Bot detected the issue body's language is not English, translate it automatically.
Title: 🐛 [Bug]: grid component, new or inserted data data-rowid is not arranged in order
您好~,目前可以通过 this.$refs.grid.getData(0) 这样的方式来获取第一条数据。
Bot detected the issue body's language is not English, translate it automatically.
Hello~, currently you can get the first piece of data through this.$refs.grid.getData(0).
getData
此方法在平铺的数据可以,树形数据失效,获取不到子集的数据
Bot detected the issue body's language is not English, translate it automatically.
getData
This method works for tiled data, but fails for tree-shaped data, and no subset of data can be obtained.
@David-TechNomad 经过评估,id按照顺序排序的方案是不可取的,这意味着unshift后,原本所有表格行id都将改变,针对你说的这种情况,建议可以通过row-id
自定ID的方式实现。然后通过方法getRowById
获取对应的数据
Bot detected the issue body's language is not English, translate it automatically.
@David-TechNomad After evaluation, the solution of sorting IDs in order is not advisable. This means that after unshift, all table row IDs will be changed. For this situation you mentioned, it is recommended to use
row-id
to automatically Implemented by specifying ID. Then get the corresponding data through the methodgetRowById
Version
v3.14.0
Vue Version
v 3.4
Link to minimal reproduction
data-rowid
Step to reproduce
grid 组件,新增或者插入数据data-rowid没有按顺序排列![image](https://github.com/opentiny/tiny-vue/assets/23149356/c7f8f8db-93fa-430c-95c9-aac76bea4c06)
What is expected
grid 组件,树形表格新增或者插入数据data-rowid希望按顺序排列,或者可以增加通过seq获取数据的方法。需要实现的功能是shift功能,如果id乱了,shift获取到的中间数据就乱了,看seq是按 顺序排的 ,所以增加一个通过seq获取数据的方法也可以
What is actually happening
No response
What is your project name
bom树表组件
Any additional comments (optional)
No response