最新的调研跟进,我们的SpreadJS产品是基于单元格粒度而非行列,因此只对绑定的内容进行双向绑定的实现,如您的图片所示id并没有进行绑定,就不会跟着排序进行更换,如果您想保持排序后id也和其他字段保持一致,您需要将id进行绑定,然后通过visible参数不让id显示:
sheet.bindColumns([
{ name: "id", displayName: "ID", visible: false, size: 200 },
{ name: "details", displayName: "Details", visible: false, size: 200 },
{ name: "name", displayName: "Name", size: 200 },
{ name: "price", displayName: "Price", size: 120 },
{ name: "2023-01", displayName: "2023/01Count", size: 150 },
{ name: "2023-02", displayName: "2023/02Count", size: 150 },
{ name: "2023-03", displayName: "2023/03Count", size: 150 },
]); |