Unplanned
Last Updated: 21 May 2019 08:25 by ADMIN
John A
Created on: 06 May 2019 02:16
Category: TreeList
Type: Feature Request
1
Allow filterable operators override

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

 

5 comments
ADMIN
Alex Hajigeorgieva
Posted on: 11 May 2019 01:06
Hi, John,

The item for overriding filterable operators is available to vote here:

https://feedback.telerik.com/aspnet-core-ui/1407732-allow-filterable-operators-override

To vote for TreeList binding to DataTable, go to:

https://feedback.telerik.com/aspnet-core-ui/1409096-treelist-bind-from-datatable

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
John A
Posted on: 10 May 2019 05:59

Thank you Alex, Looks likes Attachment missing. Thank you.

 

Please proceed to make it available for public. Thank you.

 
ADMIN
Alex Hajigeorgieva
Posted on: 08 May 2019 13:18
Hello, John,

The Kendo UI TreeList ToTreeDataSourceResult() filtering logic currently needs to have a model with defined types in order to perform the filtering correctly on the server. The result it returns should contain all the children that meet the criterion.

Currently the TreeListQuerableExtentions do not have a DataTable overload which means the filter expression is meaningless and errors are thrown.

I can submit a Feature request on your behalf or convert this ticket to a public Kendo UI Feedback item and people can upvote it. The more people vote for this functionality, the sooner we will put it in our future planned features.

Meanwhile, if you wish to use the approach that is demonstrated in the attached project, you can continue to do so, but the ServerOperations() should be set to false.

.DataSource(dataSource => dataSource
  .Model(model =>
  {
      var id = Model.PrimaryKey[0].ColumnName;
      model.Id(id);
      model.ParentId<Nullable<double>>("ReportsTo").Nullable(true);
 
      foreach (System.Data.DataColumn column in Model.Columns)
      {
          var field = model.Field(column.ColumnName, column.DataType);
          if (column.ColumnName == id)
          {
              field.Editable(false);
          }
      }
  })
  .Read(read => read.Action("Read", "Home"))
  .ServerOperation(false)
  .Update(update => update.Action("Update", "Home"))
)

I apologize for any inconvenience that this may cause you. Let me know if you would like me to convert this thread to a public item.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
John A
Posted on: 08 May 2019 05:14

Hi Alex,

Thank you. Facing issue while using filter. Please find attached solution.

When i apply filter on column ProductId got the below exception:

Attached Files:
ADMIN
Alex Hajigeorgieva
Posted on: 06 May 2019 11:22
Hi, John,

Thank you for the provided information. The Kendo UI TreeList for ASP.NET Core is missing these definitions indeed. We have an open issue about it and I have just raised its priority so it can be assigned to a developer quicker. You may follow its progress at:

https://github.com/telerik/kendo-ui-core/issues/2883

Meanwhile, the workaround is to overwrite the list of operators in the default FilterMenu configuration before the widget is initialized.

<script>
     kendo.ui.FilterMenu.fn.options.operators.string = {
       contains: "Contains"
     };
</script>

Please accept our apology for any inconvenience that this may have caused.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.