Repeater. highlighting rows from a specific point and above

Hi, If anyone out here in the axure world could help me. In a repeater when I click on a specific row I want that row and all of the rows above it to highlight green. I want it to be dynamic so that you can click on any of the rows that this event will happen

I have tried the approach of marking rows i.e rule: [[Item <= Item.index]] and then creating a condition saying value that item.ismarked = true to be selected.

I am not sure if my “equation” there is correct or if my logic is flawed but if anyone could help id be eternally greatful. I have been stuck on this for days.

Hi AmyHolley

Here’s a demo with 2 versions.

The one on the left is ‘cosmetic only’ - that is it’s just changing the way the rows look without actually changing the repeater. The one on the right is more ‘correct’ as the click actually updates repeater values (‘SELECTED’) which updates the display when OnItemload happens. It give you a bit more to use assuming you want to do something else with those rows. I’ve commented the interactions in both. Hope it’s useful.

https://zwwf4w.axshare.com/

Here’s the file.
Select_previous_rows.rp (63.0 KB)

1 Like

Mike I can’t thank you enough! You are a genuis! This is exactly what I was hoping to achieve. I also see where I went wrong. Never thought about it the way you have gone about it.

I really appreciate the help. You have prevented me from going grey early on in life.

:+1: - No problem - M

In the right hand version, I’m pretty sure (though not 100%!) you can’t update a repeater ‘from within’ as it were. The ‘fire event’ on the outside button updates the repeater rows.

1 Like

Hi Mike, come cross one more thing that if you don’t mind helping me on that I have tried but don’t seem to be getting right. On the NON-COMESTIC example: if one of the rows has a certain value is there a way to add to the expression in the update row to tell it to ignore and not select that row?

Hi AmyHolley

I’ve added more rows to the right hand repeater - some of which have ‘5’ in the value ‘NUMBER’.

These rows are being updated with ‘0’ - so not showing - with an extra line on the ‘Update Rows’ button (which I’ve hidden OnLoad to tuck it away) which is being fired as before.

This uses some more javascript within Axure - ‘IndexOf’ - search elsewhere on the forums for other examples / explanation of this. I’d recommend not complicating your prototypes too much - depending on what you’re doing!

https://fp60o3.axshare.com/

and the file

Select_previous_rows_v2.rp (69.1 KB)

Cheers - MG