How to set kendo configuration globally?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
ORS61
Posts: 15
Joined: Fri Dec 18, 2015 9:35 pm
Location: Trabzon

How to set kendo configuration globally?

Post by ORS61 »

I'm not sure if title describes it but what I want to achieve is like below;

I want to change behavior of dropdown search and it's working if I add some code to initialization script of the attribute.

Code: Select all

//The minimum number of characters the user must type before a filter is performed. 
config.config.minLength= 3;

//Specifies the delay in milliseconds before the search-text typed by the end user is cleared.
config.config.delay= 700;

//If set to true the widget will not show all items when the text of the search input cleared. 
//By default the widget shows all items when the text of the search input is cleared. Works in conjunction with minLength.
config.config.enforceMinLength= true;
I'm trying to avoid extra work by adding this code to every dropdown search attribute, so wonder if anyway to apply this globally to every dropdown by default.
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: How to set kendo configuration globally?

Post by aware_support »

No, unfortunately, you cannot do it globally.
Aware IM Support Team
johntalbott
Posts: 619
Joined: Wed Jun 17, 2015 11:16 pm
Location: Omaha, Nebraska
Contact:

Re: How to set kendo configuration globally?

Post by johntalbott »

It's not exactly what you are looking for, but I suggest using your code in a global function in a custom JS file.

Code: Select all

function configureDropdown(config) {
     //The minimum number of characters the user must type before a filter is performed. 
     config.config.minLength= 3;

     //Specifies the delay in milliseconds before the search-text typed by the end user is cleared.
     config.config.delay= 700;

      //If set to true the widget will not show all items when the text of the search input cleared. 
     //By default the widget shows all items when the text of the search input is cleared. Works in conjunction with 
     minLength.
     config.config.enforceMinLength= true;
}
Then in the attribute initialization script, call the function.

Code: Select all

configureDropdown(config);
You still have to "touch" each attribute, but the good news is that any configuration changes you make in the function will be reflected globally. And you can make the change without stopping/restarting AIM. Just remember to clear your browser cache.
VocalDay Solutions - Agility - Predictability - Quality

We specialize in enabling business through the innovative use of technology.

AwareIM app with beautiful UI/UX - https://screencast-o-matic.com/watch/crfUrrVeB3t
ORS61
Posts: 15
Joined: Fri Dec 18, 2015 9:35 pm
Location: Trabzon

Re: How to set kendo configuration globally?

Post by ORS61 »

johntalbott wrote:It's not exactly what you are looking for, but I suggest using your code in a global function in a custom JS file.
Thank you, great advice. At least I will modify attributes once.
Post Reply