Change widget size inside a repeater

Inside my repeater I’m using a widget to denote categories (ex. pill with category names). Right now the width is the same regardless of the text within. I’d like to define the width depending on that text.

I was thinking the best way to do this was via the OnItemLoad interaction and then using cases to define the widths based on the text within them. It doesn’t seem this is possible because that includes all the Set Text interactions to match the repeater data with their widgets.

I saw there was on for an OnLoad interaction. I added 4 cases to cover the different categories For example, If text on [widgetname] equals [text], set size to [x] width x [y] height.

Would appreciate some ideas on how to do this.

(BTW, the tags below some of the topics within the Axure forum are what I’m trying to accomplish.)

Hi!

This might be easier to maintain, and you won’t need huge cases.

Add two columns to the repeater’s dataset called “w” and “h” for the desired width and height of your pill for each row.

Then, in OnItemLoad for the repeater, add this command:

Set size of (text widget) to [[Item.w]], [[Item.h]]

1 Like

Thanks @josephxbrick , that’s a clever solution!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.