Custom Button to clear all Groups and Disable drag n drop

0 Answers 433 Views
Drag and Drop Grid
Aravind
Top achievements
Rank 1
Aravind asked on 30 Jun 2021, 02:22 AM

Hi ,

            Attached is a version of JavaScript we use to bind dynamic data to kendo grid with dynamic columns and server side grouping enabled. (As seen in the logic, we use a group column to group and ungroup column to ungroup on a field.)

I am looking forward for implementing the below. Please provide a sample version of the modified js file and/or links to appropriate client side events that can support these in a logical order.

1. How to disable the default behavior of drag and drop on grouping , but still show the grouping grey bar above the grid? 

I tried the below but it is not working(can't find the equivalent draggable event for group)

https://docs.telerik.com/kendo-ui/controls/interactivity/draganddrop/how-to/disable-dragging-runtime

2. Provide a “clear groups” button in the grouping bar and upon clicking that button, clear all groups. (Please note that the “clear groups“ button to be shown, only when at least one group is enabled.

3. Show the Grouping  grey bar if you group by at least one column and hide the grey bar, if there are no columns to group by. Please confirm if the logic implemented in the attached file to hide and show the grouping grey bar is the correct approach.

Thanks,

Martin
Telerik team
commented on 02 Jul 2021, 11:32 AM

1. As far as I understand, you wish to avoid having to drag/drop a column in order to group the Grid data. If that is the case, could you please elaborate a bit how a group should be set?

2. Here you will find a small example to clear the groups.

3. I am not sure I completely understand that part. The grey bar that contains the group name and the row value is displayed when at least one group is set, and not displayed if no groups are set. Could you please elaborate a bit more what I am missing here?

Aravind
Top achievements
Rank 1
commented on 02 Jul 2021, 12:16 PM

Hi,
Please find answers below. Thank You for the solution from 2.

1. If you see the reports.txt(attached), you will see two column menu items which are "Group Column" and "Ungroup Column". Upon select of those column menu items, it should perform group and ungroup.

3. Yes, It is the group by grey bar shown above the grid, and if you group by at least one column, then show the bar. Hide the grey bar, if there are no columns to group by.

Thanks,
Martin
Telerik team
commented on 07 Jul 2021, 11:31 AM

1. You can add data-groupable:false to the column header via the columns.headerAttributes option. Here is a small example for reference.

3. That is currently the default behavior when grouping in the Grid. Let me know if I am still missing something.

No answers yet. Maybe you can help?

Tags
Drag and Drop Grid
Asked by
Aravind
Top achievements
Rank 1
Share this question
or