Josh
05:04 Question 2 Revised: what is the proper form for
set-face/field tt2 "1" filters
GrahamC
05:06 Perhaps it's something like
do-actor tt2 'on-filter-data [undocumented filter dialect ]
05:07 tt1: text-table 600x400 ["ID" #1 70 "Last Name" #2 200 "Given Name" #3 200 ] ind on-action [
filter: first pick get-facet face 'table-data arg/y
; set the filter on the table here
draw-face tt2
]
05:10 In the Saphirion docs, there is this docs\specs\styles\text-table but it's not very helpful
Josh
05:10 On the r3-gui changelog I found Under 10-Mar-2012:
TEXT-TABLE: Can set filters using [set-face/field table filters]
05:10 Yeah, i've been reading and re-reading that
GrahamC
05:10 Well, have to ask Rebolek .. he wrote the text-table
05:14 reading the docs, I would have thought
get-facet face 'row
would work too but that returns none for me
Josh
05:32 Dug through r3-gui.r and found this:
do-actor tt2 'on-filter-data [1 [value = 1]]
which seems to work
05:33 though I have not the faintest what it is really doing
GrahamC
05:55 Ok, so this works then
]
ind: [ [1 "Jones" "Tom"] [2 "Smith" "William"] [3 "Jones" "Stephen"] ]
eve: [ [1 "Arrival" "Wearing a red hat"] [1 "Departure" "No hat"] [2 "Lunch" "Salmon Sandwich"] [1 "Dinner" "Pasta"] [2 "Departure" "Red shirt"] ]
view [ tt1: text-table 600x400 ["ID" #1 70 "Last Name" #2 200 "Given Name" #3 200] ind on-action [ filter: first pick get-facet face 'table-data arg/y
do-actor tt2 'on-filter-data compose/deep [1 [value = (filter)]] draw-face tt2 ] tt2: text-table 600x400 ["ID" #1 70 "Event" #2 150 "Description" #3 300] eve ]
Cyphre
09:22 Josh, Graham, the more "correct" SET-FACE version works as well. You just need to pass map! instead of block! like:
REBOL []
ind: [ [1 "Jones" "Tom"] [2 "Smith" "William"] [3 "Jones" "Stephen"] ]
eve: [ [1 "Arrival" "Wearing a red hat"] [1 "Departure" "No hat"] [2 "Lunch" "Salmon Sandwich"] [1 "Dinner" "Pasta"] [2 "Departure" "Red shirt"] ]
view [ tt1: text-table 600x400 ["ID" #1 70 "Last Name" #2 200 "Given Name" #3 200 ] ind on-action [ filter-value: first pick get-facet face 'table-data arg/y set-face/field tt2 make map! compose/deep [ 1 [value = (filter-value)] ] 'filter ] tt2: text-table 600x400 ["ID" #1 70 "Event" #2 150 "Description" #3 300] eve ]
Josh
17:34 Cyphre, Sweet. That is exactly what I was trying to do. thank you so much!
Josh
18:51 Bug or expected behavior?
REBOL []
load-gui
ind: [ [1 "Jones" "Tom"] [2 "Smith" "William"] [3 "Jones" "Stephen"] ]
view [ tt1: text-table 600x400 ["ID" #1 70 "Last Name" #2 200 "Given Name" #3 200 ] ind tt2: text-table 600x400 ["ID" #1 70 "Event" #2 150 "Description" #3 300] ind button on-action [set-face/field tt2 make map! compose/deep [1 [value = "1"]] 'filter] ]
click the button and look at the red filter drop down on tt2. There are two <=======> options. Should there only be one when a filter is in place?
Cyphre
19:20 I don't know what does the "<=======>" option mean exactly so let's see if Rebolek can comment on that.
Robert
21:50 IIRC (it's been a while that I used it):
do-actor tt2 'on-filter-data [1 [value = 1]]
The [1 [value = 1]] part means: - filter column 1 - filter by value 1
21:51 VALUE is the word that's used by the filter code to compare for TRUE or FALSE
21:51 I think it's even possible to filter by more than one column, filtering is applied in order. So first filter, than on the result-set, 2nd filter etc.
Luis
22:51 How to programaticaly set drop-down at i.e the second item of data ?
Luis
23:42 view[ d: drop-down [ "11" "22" "33"] on-action []button "set drop-down to 2" on-action [set-face d 2]]