cancel
Showing results for 
Search instead for 
Did you mean: 

Filter on and off for the table

Former Member
0 Kudos

Hi,

I was able to put filter on the table.

I create a toolbar button that initially displays text as "Filter On" and when i click on that filtering will be enabled.

But again when i click on the button i want to disable filtering

here is the code which i wrote

IWDTableColumn Column = (IWDTableColumn) view.getElement("Column") ;

Column.bindFilterValue("VoFilter.Airline");

IWDTableColumn Column2 = (IWDTableColumn) view.getElement("Column2") ;

Column2.bindFilterValue("VoFilter.city");

wdContext.currentContextElement().getTableFilter().filter(null,wdContext.nodeFilter_Flights(),

wdContext.nodeFlight_List(),

wdContext.nodeVoFilter());

IWDToolBarButton button = (IWDToolBarButton)view.getElement("ToolBarRightItems");

if(button.getText()!=null&&button.getText().equals("Filter On"))

button.setText("Filter Off");

else

if(button.getText()!=null&&button.getText().equals("Filter Off"))

{

button.setText("Filter On");

Column2.setFilterValue("");

Column.setFilterValue("");

}

Please let me know how to disable the filtering

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

To disable to the filter write following code in event handler of the button "Filter On"

wdThis.wdGet<OnFilterActionName>().setEnabled(false);

to enable the filter,

wdThis.wdGet<OnFilterActionName>().setEnabled(true);

Former Member
0 Kudos

Kranthi,

I figured out how to resolve the issue but your code helped me a lot .

so I am giving you full points

Thanks

Bala

Former Member
0 Kudos

BTW, you don't need to do the filer with code as you mentioned in the first post. You can do it in design time itself. Easy and quick!

Answers (0)