If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#44213 by ORS61
Tue Aug 01, 2017 11:01 pm
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.
#44217 by johntalbott
Wed Aug 02, 2017 12:25 am
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 allfunction 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 allconfigureDropdown(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.
#44223 by ORS61
Wed Aug 02, 2017 11:58 am
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.

Who is online

Users browsing this forum: No registered users and 43 guests