on 01-25-2006 10:21 AM
Hi,
I've got a requirement to add to my table a toggle button, which would hide and display the filter row.
Is that possible?
Thanks in advance,
Julia.
Hi Julia,
It is very much possible.
Follow the following steps:
1. Create a table toolbar, and add a button to this tool bar.
2. associate some action to this table toolbar button (say "toggleFilter").
3. In the implementation of the view, declare a static boolean variable (begin others section)
public static boolean toggleFilter = false;
4. in the action of "toggleFilter" write the code
toggleFilter = toggleFilter?false:true;
5. In the wdModifyView method write the following code
IWDTable iwdt = (IWDTable)view.getElement("Table1");
if(toggleFilter) {
iwdt.setOnFilter(null);
}
else {
iwdt.setOnFilter(wdThis.wdGetAPI().getAction("filter"));
}
Hoping that this helps.
Thanks and regards
Radha Krishna .B
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Julia,
After Radha's post I can only say... Just forget my previous reply )
His solution is much simplier.
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Julia,
Yes, this is possible.
In brief words you have to:
1. Create some flag attribute in context (int with 3 values 0 -- no changes, 1 -- show, 2 -- hide filter)
2. In action handler for toggle set this flag to either 1 or 2.
3. In wdDoModifyView check if flag is not equal to zero.
4. If check in [ 3 ] is true, then iterate over all table columns and bind "filter" property of column either to necessary attribute or to null (unbind).
5. After [ 4 ] set flag to zero in wdDoModifyView.
Note that toggle state and flag shoud be independend attributes.
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.