Add filter option to table. I have to filter variable "cab1" based on alphabets and then select.
Find more posts tagged with
WHere i sould add this to my above code
@tinh Its working. Thanks for this.
But I want it in a different way.
That is, I can select from checklist + when I filter and select = Total check
That is , when I filter list should come as filter and will get selected , then comes without filter with selected....like appending and refreshing
@tinh you have wrongly taken. Your script is ok. What i want is when I filter and select, the selections should append to previous selections and come back for full selection
It does not have a method to hide rows
So once we delete rows (to show again filtered ones), last selection was lost
When you filter it, set a global variable ::v_Filtering = 1, when you clear all selection (reset) => set it 0
and in selectcommand proc, use that variable to decide to append or subtract or reset selected variable
Do you understand?
Hi
the code is like this:
....
$recess.sl rowadd row$I -values [list entities ...
lappend ::FullTable [list entities ...
incr I
}
button $w.bFilter -text Filter -command {::texample::p_Filter [::hwtk::inputdialog -title Filter -text Filter]}
pack $w.bFilter
proc ::texample::p_Filter {Filter {Index 1}} {
if {![string equal '' $Filter]} {
if {[string first * $Filter]==-1} {append Filter *}
set NewList [lsearch -glob -nocase -all -inline -index $Index $::FullTable $Filter]
} else {
set NewList $::FullTable
}
foreach row [$::recess.sl rowlist] {$::recess.sl rowdelete $row}
foreach row $NewList {
$::recess.sl rowadd row[incr i] -values $row
}
}