tiny-vue icon indicating copy to clipboard operation
tiny-vue copied to clipboard

🐛 [Bug]: grid 组件,树形表格新增或者插入数据data-rowid没有按顺序排列

Open David-TechNomad opened this issue 10 months ago • 7 comments

Version

v3.14.0

Vue Version

v 3.4

Link to minimal reproduction

data-rowid

Step to reproduce

grid 组件,新增或者插入数据data-rowid没有按顺序排列 image

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

David-TechNomad avatar Apr 02 '24 07:04 David-TechNomad

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

Issues-translate-bot avatar Apr 02 '24 07:04 Issues-translate-bot

您好~,目前可以通过 this.$refs.grid.getData(0) 这样的方式来获取第一条数据。

gimmyhehe avatar Apr 18 '24 06:04 gimmyhehe

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).

Issues-translate-bot avatar Apr 18 '24 06:04 Issues-translate-bot

getData

此方法在平铺的数据可以,树形数据失效,获取不到子集的数据

David-TechNomad avatar May 07 '24 08:05 David-TechNomad

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.

Issues-translate-bot avatar May 07 '24 08:05 Issues-translate-bot

@David-TechNomad 经过评估,id按照顺序排序的方案是不可取的,这意味着unshift后,原本所有表格行id都将改变,针对你说的这种情况,建议可以通过row-id自定ID的方式实现。然后通过方法getRowById获取对应的数据

gimmyhehe avatar Jul 31 '24 08:07 gimmyhehe

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 method getRowById

Issues-translate-bot avatar Jul 31 '24 08:07 Issues-translate-bot