Add repeater filter on clicking another button separate to the search field

Hey all,

I’ve followed the Repeater tutorials, without problem. For example, I’ve set up a simple search/filter table so that I can type a couple of letters into a search field and it correctly filters my repeater table onTextChange.

Instead, I want to type those letters into the search field and then instead of filtering immediately onTextChange, I want to add the filter via a search / submit button.

I thought this would be straight-forward, via a local variable but I’m going mad! :slight_smile:

I’m trying:

To add text to a text box widget called ‘searchField’

Below this, on a submit/search button:

OnClick
if text on searchField does not equal “”
Add filter
[[Item.searchColumn.toLowerCase().indexOf(LVAR1.text.toLowerCase()) >= 0]]

Where ‘searchColumn’ is a column in my repeater table
and LVAR1 = text on widget ‘searchField’

That seems to make sense… when I put text in searchField and press the submit button, all rows of the repeater disappear. So it is matching something to something. Just not to the something I want! :slight_smile:

Any help would be appreciated!

Thanks,
Tim

You don’t need the “.text” if LVAR1 is already set to “text on widget”:

[[Item.searchColumn.toLowerCase().indexOf(LVAR1.toLowerCase()) >= 0]]

Can’t guarantee there isn’t something else going on without seeing the file, but that’s where I’d start.

Perfect! Yes of course. Makes sense now but I was lost in the fog! :slight_smile:

Thanks so much.

You’re welcome. Very easy to get lost in the fog in Axure :slight_smile:

1 Like