Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
I know in the Grid component, there is a visible property that can be set on the columns.command. That works well for conditionally showing a command.
I'm not seeing that in the TreeList. How can I conditionally show a command in a TreeList based on the row data?
Hi, Kevin,
You can use the dataBound event of the TreeList to programmatically show/hide the commands:
dataBound: function(e) { const data = this.dataSource.view(); data.forEach((item) => { if(item.LastName == "Wooten" || item.LastName == "Weber") { const row = this.element.find("tr[data-uid="+item.uid+"]"); // Classes: // .k-grid-add // .k-grid-delete // .k-grid-edit row.find(".k-grid-add").css("display", "none"); } }); }
Runnable Dojo:
https://dojo.telerik.com/@gdenchev/IqasUVaf
Best Regards, Georgi Denchev Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
That worked perfectly, thank you Georgi.
In my case, I was using a custom command so I used the command.className and then used your example to find the action using the custom CSS class name.