Add custom datalist filter quickly

Showing results for 
Search instead for 
Did you mean: 

Add custom datalist filter quickly

Active Member II
0 0 1,567

This post will allow you create an additional filter to your datalist in a simple and fast way.

  • AIO project or failing [your-project]-platform and [your-project]-share
  • Alfresco SDK 3.0

  1. Overwrite js [] webscript files
  2. Overwrite config [] webscript file


Step 0:

First of all create your AIO project in your IDE.

Step 1:

Copy to your platform project path:

src > main >  resources > alfresco > extension > templates > webscripts > org > alfresco > slingshot > datalists

This will overwrite the [] js webscript file.

Edit file and add else if() block in the getData() function:

if (filter == null || filter.filterId == "all")
else if (filter.filterId == "MyCustomFilter")
     // Use non-query method
     var parentNode = parsedArgs.listNode;
     if (parentNode != null)
         var pagedResult = parentNode.childFileFolders(true, false, Filters.IGNORED_TYPES.concat(Filters.IGNORED_ASPECTS), 1, -1, REQUEST_MAX, "cm:name", true, null);
         allNodes =;


We have modified childFileFolders() function for a simple test but at this point you could implement your request to the repository saving all your response items in allNodes var.

Step 2:

Copy  filter.get.config.xml to your share project path:

src > main > resources > alfresco > web-extension > site-webscripts > org > alfresco > components > data-lists

This will overwrite the [] config webscript file.

Edit filter.get.config.xml file and add <filter tag line:

    <filter id="MyCustomFilter" label="Custom filter label" />

This new tag will show a new filter in the left datalist page menu.


If you want implement a complex repository query for your filter  check out and overwrite evaluator.lib.js and filters.lib.js files in platform project and modify its nested functions.

I hope it saved you time and have a nice day