Problem with ToTreeDataSourceResult method when filtering on root and child level.
Also applying filtering causes a significant slowdown in the query created by the ToTreeDataSourceResult method even when applied to small datasets.
Please refer to the code below and simply filter the first column with the value of 5.
//View
@(Html.Kendo().TreeList<WebApplication1.Models.SerialModel>()
.Name("treelist")
.Toolbar(toolbar => toolbar.Create().Text("New Level"))
.Columns(columns =>
{
columns.Add().Field(e => e.RecordID).Width(280);
columns.Add().Field(e => e.SerialNumber).Width(160);
columns.Add().Field(e => e.Name);
columns.Add().Field(e => e.Location).Width(200);
columns.Add().Field(e => e.ParentID).Width(140);
columns.Add().Command(c =>
{
c.CreateChild().Text("New Child");
c.Edit();
c.Destroy();
}).Width(250);
})
.Editable(editable => editable.Mode("inline")).Filterable(true).Filterable(f => f.Extra(false))
.DataSource(dataSource => dataSource
.Read(read => read.Action("TreeListData", "Home"))
//.ServerOperation(false)
.Model(m =>
{
m.Id(f => f.RecordID);
m.ParentId(f => f.ParentID).DefaultValue("0");
})
)
.Height(540)
)
//Controller code:
public ActionResult TreeListData([DataSourceRequest]DataSourceRequest request, int? id)
{
var source = Enumerable.Range(1, 5).Select(x => new SerialModel()
{
RecordID = x,
SerialNumber = x,
Name = "Name " + x,
Location = "Location " + x,
hasChildren = true,
ParentID = x < 5 ? 0 : (x / 5)
});
return Json(source.ToTreeDataSourceResult(request, e => e.RecordID,
e => e.ParentID, e => id.HasValue ? e.ParentID == id : e.ParentID == 0, m => m));
}
Instead of 1 record it returns 2 same items.
Filtering of the TreeList should be as fast as sorting.
Problem Statement: Unable to set the Filterable operators instead of default's in Tree List .Net Core.
When i add the below to the TreeList :
.Filterable
(f => f
.Operators(op => op
.ForString(str => str.Clear()
.Contains("Contains")
.DoesNotContain("Does not contain")
.StartsWith("Start with")
.EndsWith("Ends with")
.IsEqualTo("Is equal to")
.IsNotEqualTo("Is not equal to")
)))
Error:
Severity Code Description Project File Line Suppression State
Error CS1061 'TreeListFilterableSettingsBuilder<dynamic>' does not contain a definition for 'Operators' and no accessible extension method 'Operators' accepting a first argument of type 'TreeListFilterableSettingsBuilder<dynamic>' could be found (are you missing a using directive or an assembly reference?) MSA_Client_Portal C:\Users\anilc\source\repos\Client Portal - NEW\src\MSA_Client_Portal\Views\LegislationSection\LegislationTree.cshtml 90 Active
I'd like to see the Editable.Window Configuration in TreeLists like in Grids, one would actually expect this configuration to be available on all controls that have an Editable configuration.
On a grid I use this code to set AutoFocus, but it is only available through JQuery on a TreeList.
.Editable(editable => editable.DisplayDeleteConfirmation(false) .Mode(GridEditMode.PopUp) .TemplateName("AccountEditor") .Window(w => w .Scrollable(false).AutoFocus(false) ))
Thanks
M
I have worked with the grid and have successfully been able to change the update/cancel button text/icon for inline editing using the code below.
commands.Edit().Text(" ").IconClass("fa glyphcolor fa-edit").CancelText(" ").CancelIconClass("fa fa-times").UpdateText(" ").UpdateIconClass("fa fa-check");
For the TreeList the IconClass, CancelText, CancelIconClass UpdateText or UpdateIconClass are not exposed functions. Currently using JQuery and CSS you can workaround this but I would be nice if the TreeList exposed this functionality as the grid does.
.HtmlAttributes is available to columns, but not to elements such as commands.
columns.Add().Command(command => {
command.CreateChild();
command.Edit();
command.Destroy();
command.Custom().Name("custom").Text("Details").Click("cmdDetails");
command.Custom().Name("change").Text("Change Control").Click("cmdChangeControl");
});
Should work the same as other elements/components and allow:
command.Edit().HtmlAttributes(new { type = "button", @class = "btn btn-primary" }); <- from grid.
Bug report
Column.Filterable.Ui option of the TreeList widget does not call the handler function. Can be replicated only in ASP.NET Core.
Environment
* **Kendo UI version:** 2020.2.617
* **jQuery version:** 1.12.4
* **Browser:** [all]
Setting the HeaderHtmlAttributes of the TreeList throws a Null reference exception.
@(Html.Kendo().TreeList<Kendo.Mvc.Examples.Models.TreeList.EmployeeDirectoryModel>()
.Name("treelist")
.Columns(columns =>
{
columns.Group(group => group
.Title("Personal Info")
.HeaderHtmlAttributes(new {@class="myClass"})
.Columns(info =>
{
//...
})
);
})
Null reference exception is thrown.
The Html attributes should be added to the header.
In ASP.NET Core, when using a TreeList with a data source that gets referenced by its id (instead of defining the data source directly on the TreeList), the built-in search functionality of the toolbar does not apply the filter to the data source. On each change of the search text the data source will send a new request, but the filter parameter is always null. When using the same approach for the Grid widget, the filter gets applied as planned. The attached project shows the behavior for both the TreeList and the Grid in detail.
Is this a bug? Is there another workaround than applying the data source directly to the TreeList (e.g. using JavaScript)?
### Bug report
When the Drag-and-Drop functionality is enabled, the Update operation is not triggered when editing an existing item.
### Reproduction of the problem
1) Create an InLine editable TreeList;
2) Enable the dragging and dropping of the rows;
3) Edit an existing record and click the "Update" command. If you click at the span element "k-button-text", the Update request does not trigger. If you click outside of this element, the request triggers as expected.
A Dojo sample for reproduction: https://dojo.telerik.com/UQuzAnUN
### Expected/desired behavior
The "InLine" editing should work when the "move" option is enabled.
### Environment
* **Kendo UI version: 2022.2.802
* **jQuery version: 1.12.4
* **Browser: [all]
InLine Editable TreeList doesn't send all its data on Create and Update, if it is reorderable and the "Update" text of the Update button is clicked
For a visual reproduction guide review this screen capture
When the text of the Update button is clicked a part of the updated data item isn't sent to the server.
The whole data item has to be send to the server on Update/Create
When server-side localization is used Filtering is always enabled.
Runnable sample is available in ticket 1580765
The Filterable.Operators automatically configures the messages for the string, number, date and enum operators based on the resx files.
Filtering for the TreeList is always enabled.
Filtering for the TreeList should be configurable irrespective of whether localization is used or not.
After the TreeList is initialized call the setOptions method and disable filtering:
$(document).ready(function(){
var treelist = $("#treelist").getKendoTreeList();
treelist.setOptions({
filterable:false
});
})
When you have configured the norows with a text and the server does not respond with a valid answer instead of displaying only the status you get to see both the norecords template and the failed status template.
There should be only one of them visible and the failed status template should take precedence.
Starting from 2024.1.130 when the TreeList's Edit mode is configured to be InCell and the user interacts with the caret icon instead of collapsing/expanding appropriately the Component enters edit mode for the first column of the row.
Collapsing and expanding of the TreeList should work correctly upon user interaction.
The TreeList doesn't have a NoRecords , nor NoRecordsTemplate configuration. As a result the content of the .k-grid-norecords-template element of the Component cannot be evaluated with Kendo Templates on the client-side.
Please implement these methods for the TreeList as well.
Align more to grid items (since treelist is essentially a grid with parent/child). Need a ForeignKey element to allow for helpers etc. instead of forcing override and manual Templates.
columns.Add().Field(n => n.StatusId).Title("Status").Width(150).Template("#=statustemplate(data)#"); columns.Add().Field(n => n.CategoryId).Title("Category").Width(150).Template("#=categorytemplate(data)#");
ForeignKeys should be treated the same was a grid elements and allow for the UIHint, etc.
Full alignment of the .Add function to .Bound in grid would be nice as well, but naming is as critical as the functionality.
I would like to be able to apply custom css classes to all your controls.
Whenever I want to i.e. set the width of a control, I find it's a hassle to figure out which of your css classes I have to override.
It would be much better and easier for me to work with, if I could just apply a custom css class.
Thanks,
Bo Johansen