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.
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.
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.
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