Programmatically Add a Toolbar Filter Chip?

Forum to discuss the new web client version of Servoy.

Programmatically Add a Toolbar Filter Chip?

Postby john1598360627 » Sat Apr 30, 2022 3:14 am

I want to create a Dropdown button that acts like a kind of a Quick Filter button. When you click on an item, it would add a chip automatically with a value to the filter set. This in contrast to a user manually adding their own filter chip via a list of available columns.

quick-filter.png


Screenshot 2022-04-29 180647.png


Is there a way of programmatically adding a filter chip?
You do not have the required permissions to view the files attached to this post.
john1598360627
 
Posts: 169
Joined: Tue Aug 25, 2020 3:03 pm

Re: Programmatically Add a Toolbar Filter Chip?

Postby mboegem » Mon May 02, 2022 6:13 pm

Hi John,

you can programatically set a filter doing this (for example)
Code: Select all
toolbarFilter.setFilterValue(fv_toolbarFilter.getFilter('status'), ['OPEN'], scopes.svyPopupFilter.OPERATOR.EQUALS)


where 'toolbarFilter' is the form variable on to which the filterobject is bound
I assumed 'status' would be the column name you want to filter on.

This should also be an existing filter option for the users, otherwise it won't work.

Hope this helps
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Programmatically Add a Toolbar Filter Chip?

Postby john1598360627 » Sat May 14, 2022 3:02 am

mboegem wrote:Hi John,

you can programatically set a filter doing this (for example)
Code: Select all
toolbarFilter.setFilterValue(fv_toolbarFilter.getFilter('status'), ['OPEN'], scopes.svyPopupFilter.OPERATOR.EQUALS)


where 'toolbarFilter' is the form variable on to which the filterobject is bound
I assumed 'status' would be the column name you want to filter on.

This should also be an existing filter option for the users, otherwise it won't work.

Hope this helps

Alrighty, I haven't tried this out yet since I'm working on other stuff. But when I get the chance I'll try this out.
john1598360627
 
Posts: 169
Joined: Tue Aug 25, 2020 3:03 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 6 guests

cron