Declined
Last Updated: 18 Oct 2023 08:33 by ADMIN
Eunbyul
Created on: 05 Oct 2023 07:41
Category: Grid
Type: Bug Report
0
Kendo grid doesn't work reorderable function properly

Hello Team.

I appreciate grid's reorderable function work at Nuxt3(@kendo-vue-grid: 3.14.2).

But For some reason, this function doesn't work properly. so I report a bug.

I reproduce a stackblitz code.
https://stackblitz.com/edit/nuxt-starter-gmag5m


I implemented it like this,

After fetching(=GET) column data from the server, reorder the columns using kendo grid's reorderable function and save(=POST) it on the server.

I call columnExecute function, so server refetch(=GET) column data.

at /pages/index.vue, colums ref change rightly.

at /components/grid.vue, columnList ref change rightly.

But rendered kendo grid's column doesn't change.


please check this issue. 

 

Sincerely,
Eunbyul.

Attached Files:
4 comments
ADMIN
Petar
Posted on: 18 Oct 2023 08:33

Hello, Eunbyul.

Thank you for the shared details. I am happy to hear that you managed to implement the desired functioanlity in your application. I will now close the current thread but if you need further assistance, you can reopen it and continue the communication. 

Regards,
Petar
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources

Eunbyul
Posted on: 17 Oct 2023 12:24
Hello Petar!

I'm sorry to delay a reply.

I applied a code you suggested to my stackblitz and confirmed that it works correctly.
(I confirmed that this problem was caused by the object not having an orderIndex property!)

Thank you for your assistence.

Sincerely,
Eunbyul.

 

 

ADMIN
Petar
Posted on: 12 Oct 2023 14:50

Hello, Eunbyul.

After investigating the reported issue, I can share that it is triggered by a missing property in each of the objects, part of the array passed to the Grid's columns. The property I am talking about is the orderIndex. If we add the marked in yellow line in the reorderColumn method, the reordering functioanlity is working as expected:

const reorderColumn = (event: GridColumnReorderEvent) => {
  // event.columns doesn't include hidden field.
  const [prevField, nextField] = [
    event.columns[event.prev].field,
    event.columns[event.next].field,
  ];
  const prevIdx = columnList.value.findIndex((el) => el.field === prevField);
  const nextIdx = columnList.value.findIndex((el) => el.field === nextField);

  const el = columnList.value[prevIdx];
  columnList.value.splice(prevIdx, 1);
  columnList.value.splice(nextIdx, 0, el);
  columnList.value.map((el, index)=>el.orderIndex = index);

  emits('updateColumns', { columns: columnList.value });
};

As I couldn't load the shared project, I copied it to a local one. Attached to my reply, you will find the mentioned local project in which the discussed above line is added. 

Please check the attached project and let me know if it helps you implement what you need in the application you are working on.

Looking forward to your reply.

Regards,
Petar
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources

Attached Files:
ADMIN
Petar
Posted on: 12 Oct 2023 07:31

Hello, Eunbyul.

Thank you for the shared details about the experienced issue. Before we can confirm that the reported issue is a bug we will need to do some additional research about your scenario. 

I will write you back withing the next up to 24 hours with an update regarding the current thread.

Thank you for your patience and understanding.

Regards,
Petar
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources