I have a window with a dynamic data filter. The filter is used to distill a table down before going to an external python function for post processing. The filter dynamically updates well when deleting rows. However, if I sort the rows in my data table by certain column values it seems like the table is disconnected /non-communicative with the window since changing the filter no longer triggers a python call. Even if I undo the sorting it still persists. I have a feeling that this is due to the fact that sorting function replaces the current data table and it may be necessary to somehow resync the filter.
dt = Current Data Table();
// Python execution function
run_python_func = Function( { dt },
Python Send( dt );
Python Execute(
{ },
{ output },
"\[
import jmp
# Do some stuff
output = 4 + 4
]\"
);
Show( output );
);
plot_window = New Window( "Python post process",
Data Filter Context Box(
H List Box(
cb = Check Box( "Enable real-time filtering" ),
filter = (dt << Data Filter( Local, Add Filter( columns( :DIE_ID, :MACRO, :TEST_NAME ) ) ) )
)
)
)
);
// Do real-time filtering
refresh_filter = Function( { do_filt },
If( do_filt,
// Get selected rows and filter input data table
rows = filter << get filtered rows;
dt_filt = dt << Subset( Rows(rows), selected columns(0) );
dt_filt << Show Window(0);
// Run python function
run_python_func( dt_filt );
Close( dt_filt, NoSave);
);
);
rs = filter << Make Filter Change Handler( refresh_filter( cb << Get() ) );