Add filter option to table. I have to filter variable "cab1" based on alphabets and then select.
Answers
-
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
}
}
0 -
WHere i sould add this to my above code
0 -
0
-
I edited again the code. see above
0 -
chua mot cot
0 -
@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
0 -
Can you do it base on my code?
0 -
Altair Forum User said:
Can you do it base on my code?
I was working on your code, but did not figure out to do this.
0 -
I dont know how to answer because your question is not detail, so it seems that i write all script for you and finally it is ... not what you want! Very time consuming. So just devide your work to smaller tasks...
0 -
@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
0 -
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?
0