Using "Search Field" with "View Based" Table


(Andreas Kiel) #1

Is it possible?

I haven’t found anything nor did I find an alternative.

Any ideas are really appreciated.


(Shane Stanley) #2

Sure. Searching works by the array controller filtering the content, so the type of table displaying that content is irrelevant.


(Andreas Kiel) #3

Thanks Shane,

You’re right - as always.
My question was stupid and missing details, here another try.
I’ve a view based table, it contains one column with a ‘text table cell view’. This cell contains all data per record.

Does this make more sense?


(Shane Stanley) #4

Honestly? :wink:

Sorry, I don’t follow what you’re trying to achieve. The filtering is based on whatever fields you want it to be based on.


(Andreas Kiel) #5

Okay - obviously not :slight_smile:

IB%20pic

There is a table view connected to an array controller.
There is one column containing one cell - text table cell (zRow)
The “array record items” are addressed/connected by ‘Bind -> zRow’, ‘Model Key Path -> objectValue.key’

Better now?


(Shane Stanley) #6

OK, but the search field is irrelevant to how the table is set up. (I thought you meant how to use use a search field specifically in a view-based table, rather than in general.)

Let’s say the key for your column 1 data is fileName. So you add a search field, bind its Predicate to the array controller, with a Controller Key of filterPredicate, a Predicate Format of fileName contains $value, and a Display Name of, well, it doesn’t matter if there’s only one predicate.


(Andreas Kiel) #7

Thanks for your patience Shane!

Meanwhile I understand why you didn’t understand what I meant.

I have/had two projects where I tried exactly what you described above and what I thought it was the way to do. But it did not work. There was either a ‘silent crash’ or no result.

So I did start a new little project with a less complicated table which worked better.
Another new project works fine when every ‘searchable’ thing is explicitly is coerced to text.

Thanks again.