How to hide or disable Resources Units from Kendo UI for jQuery Gantt Chart Task Popup

1 Answer 35 Views
Gantt
Abhishek
Top achievements
Rank 1
Iron
Abhishek asked on 27 Dec 2023, 06:01 PM

I don't want users to set UNITS while assigning tasks to resources, either I want to disable that column or hide the column. The default value should always be 100%.

 


1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 02 Jan 2024, 08:48 AM

Hello, Abhishek,

In the Gantt edit event, you can get a reference to the inner TabStrip component and bind to its select event. You can then get a reference to the Grid if the user clicks on the Resources tab, and call the Grid hideColumn method:

edit:function(e){
              var tabstrip = $(e.container).find($('[data-role="tabstrip"]')).data("kendoTabStrip");
              tabstrip.bind("select", function(e){ 
                var item = e.item;
                if($(item).find(".k-link").text() === "Resources"){
                  var grid = $(e.contentElement).find($('[data-role="grid"]')).data("kendoGrid"); 
                  grid.hideColumn("value");
                }
              })
            },	

Here you will find a small Dojo example demonstrating the approach.

Let me know if that works for you.

Regards,
Martin
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
Tags
Gantt
Asked by
Abhishek
Top achievements
Rank 1
Iron
Answers by
Martin
Telerik team
Share this question
or