This is a migrated thread and some comments may be shown as answers.

Filter

6 Answers 118 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Hristo
Top achievements
Rank 1
Hristo asked on 25 Nov 2019, 01:27 PM
I`m working with your new filter, but I have a problem. When I use EditorTemplateHandler and making dropdown for current column and I persist state and when I load data I lost values from dropdown. For instance if I have dropdown with dataTextField string and dataValueField string, after load my dropdown become input. Is it a normal behavior?

6 Answers, 1 is accepted

Sort by
0
Hristo
Top achievements
Rank 1
answered on 25 Nov 2019, 01:45 PM
I make mistake for dropdown dataTextField is string and dataValueField is int on upper post.
0
Viktor Tachev
Telerik team
answered on 28 Nov 2019, 08:22 AM

Hi Hristo,

 

Out of the box JSON.stringify does not serialize function references. This is why when settings are restored the custom editor is not reinitialized. 

In order to keep the custom editor I suggest adding it to the options again before calling the setOptions method. The relevant code would look like this:

$("#load").click(function (e) {
	e.preventDefault();
	var options = localStorage["kendo-filter-options"];
	if (options) {
	  options = JSON.parse(options);
	  options.dataSource = dataSource;

	  options.fields[0].editorTemplate = contactTitleEditor;

	  filter.setOptions(options);
	  filter.applyFilter();
	}
});

 

I also prepared a dojo sample illustrating how the custom editor can be persisted. The sample uses the KendoUI jQuery Grid, however, the approach for persisting the settings will be the same with the .NET Core wrappers.

 

Give the approach a try and let me know how it works for you.

 

Regards,
Viktor Tachev
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.
0
Hristo
Top achievements
Rank 1
answered on 05 Dec 2019, 12:34 PM

Hi Viktor,

It`s work great, but I have another trouble. I want to hide some of the filter comparisons and when change this behaviour my initial value is lost. I wanted to be after or equal to.

0
Viktor Tachev
Telerik team
answered on 10 Dec 2019, 08:18 AM

Hello Hristo,

 

The behavior from the screenshots can be observed if there is default filter expression applied and the operator that is used is not in the listed under the Operators option.

That said, I tried to replicate the behavior with our online examples and was not able to. Check out the video below that shows the behavior I am observing.

https://www.screencast.com/t/6cgC7JPi

 

Regards,
Viktor Tachev
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.
0
Hristo
Top achievements
Rank 1
answered on 10 Dec 2019, 10:07 AM

Hello, Viktor

I didn't express myself well. For Your example if You don`t have predefined filter expression for name , when click to add new one, it start with equal, I want to start with contains.

0
Viktor Tachev
Telerik team
answered on 10 Dec 2019, 12:15 PM

Hello Hristo,

 

Thank you for the clarification.

Specifying the order in which operators are listed is currently not available out of the box. However, if you would like the functionality to be available out of the box I suggest submitting a feature request in our feedback portal.

https://feedback.telerik.com/kendo-jquery-ui

 

We monitor the portal and prioritize items in it based on customer demand and popularity. The more votes an item has more likely it is that the item will be considered for planning in a future release.

 

Regards,
Viktor Tachev
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.
Tags
Filter
Asked by
Hristo
Top achievements
Rank 1
Answers by
Hristo
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or