Hello,
How can I add column (COUNTRIES) filter to window below?
For example, I want to see only the country a.
Thanks
newin = New Window( "Coronavirus Cases ", Outline Box( "Coronavirus Cases", VListBox( dt <<get as report()) ));
If you select the rows you want when you
dt << get as report()
You will only get the selected rows
Names Default To Here( 1 );dt = Current Data Table();dt << select where( :COUNTRIES == "a" );newin = New Window( "Coronavirus Cases ",Outline Box( "Coronavirus Cases", V List Box( dt << get as report() ) ));
@txnelson
Yes, i know that solution.I meant other solution: how I can add dynamic button filter for users in the window.Thanks
Applying a Data Filter to a data table does not delete rows from view, when not selected. Therefore, in my example below, I am taking advantage of the method in the first response, and just deleting the results of the V List Box() and totally replacing them. The trigger for the replacement is in the Make Rowstate Handler() which runs whenever something in the Rowstate column changes, which is what the Data Filter is actually doing.
Names Default To Here( 1 ); dt = Current Data Table(); newin = New Window( "Coronavirus Cases ", H List Box( Current Data Table() << Data Filter( Location( {722, 131} ), Add Filter( columns( :Countries ), Display( :Countries, Size( 178, 34 ), Height( 34 ), "List Display" ) ) ), ob = Outline Box( "Coronavirus Cases" ) ) ); vlb = V List Box( dt << get as report ); ob << append( vlb ); f = Function( {a}, vlb << delete; vlb = V List Box( dt << get as report ); ob << append( vlb ); ); rs = dt << make row state handler( f );
@txnelson You’re awesome!Sorry, but I forgot to ask -Is there an option to do this on an HTML file? - (When I save the 'newin' as HTML file).