🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Add filter option to table. I have to filter variable "cab1" based on alphabets and then select.

Jouher_20929User: "Jouher_20929"
Altair Community Member
Updated by Jouher_20929

 

@tinh @Livil Lyle 

 

image.thumb.png.919320ca88be7a5749c9e7b2c3678926.png

Find more posts tagged with

Sort by:
1 - 11 of 111
    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    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

       }

    }

    Jouher_20929User: "Jouher_20929"
    Altair Community Member
    OP
    Updated by Jouher_20929

    @tinh

    WHere i sould add this to my above code

    Jouher_20929User: "Jouher_20929"
    Altair Community Member
    OP
    Updated by Jouher_20929

    image.png.36f6149145801d5fe77a526f76ffbd23.pngimage.png.8c655e0990bb1b85263fa718f9721e28.png

    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    I edited again the code. see above

    chua mot cot

    Jouher_20929User: "Jouher_20929"
    Altair Community Member
    OP
    Updated by Jouher_20929

    @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

    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    Can you do it base on my code?

    Jouher_20929User: "Jouher_20929"
    Altair Community Member
    OP
    Updated by Jouher_20929

    Can you do it base on my code?

    I was working on your code, but did not figure out to do this.

    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    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...

    Jouher_20929User: "Jouher_20929"
    Altair Community Member
    OP
    Updated by Jouher_20929

    @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

    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    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?