Deleting a row without using OnClick, OnMouseEnter, etc

repeater-widget

#1

Hi,

I need a way where I can delete rows from my repeater without OnClick, OnMouseEnter, etc. I would preferably like to be able to delete the row during OnItemLoad or OnLoad of the repeater itself rather than the rectangle where the items are being projected. I have tested it with OnClick and OnMouseEnter and it works, but for my situation, this repeater is a copy of another repeater and so the actual repeater table does not have any pre-set values. The values actually come from another repeater that has the values pre-set on the table for the repeater.

image

Iā€™m trying to make this as maintainable as possible such that only one table will need to be changed and being able to not have to manually change conditions, etc. But, OnLoad seems to take precedence over OnItemLoad. I got the functionality to work where the row I want deleted does get deleted but only through mouse events on the rectangle where it is being projected, but the same delete conditions are not working OnLoad, I want it such that when this new repeater gets loaded, the row I want deleted is already gone before any mouse interaction. Is there any workaround to get this to work?


#2

The problem in Axure regarding repeaters, is that you canā€™t call a specific row from out side, based on its values. But I can suggest a hack. Its ugly but it works:

  1. In the repeater, give a name to the rectangle in it.
  2. You need to have some trigger. Letā€™s say that you want to delete the row by clicking on some button outside the repeater. Click on that button will Move that rectangle by 0px.
    What will happen is that click on the button will move all the rectangles in all the rows.
  3. add a ā€œOnMoveā€ action to that rectangle with a condition. In the condition, check if this specific row matches yout condition. (if a value matches another value, or the index number matches something).
    If yes, delete that row.

Update - I added an example:

Delete in target repeater.rp (57.1 KB)


#3

Iā€™m curious about what youā€™re attempting to do, because Iā€™m pretty confused.

Based on how youā€™re describing what you want, it would be impossible. You are correct that OnLoad takes precedence over OnItemLoad. The repeater has to exist before any rows inside it can exist, so thatā€™s why you canā€™t use a repeaterā€™s OnLoad event to delete one of itā€™s own rows. Now, you should should be able to use a repeaterā€™s OnLoad to delete a row in another repeater, so long as that repeater is loaded first.

You could mimic a ā€œsoft deleteā€ by setting a column in the repeater like ā€œIsDeletedā€ and OnItemLoad check for IsDeleted == ā€˜trueā€™ and then hide of filter out those rows. You wouldnā€™t be actually deleting anything from the repeater, it would just look like you did.

And, hey, you can simulate an ā€œUndoā€ command now too! :grin:


#4

Itā€™s not exactly what I was looking for, but it did give me a different idea I hadnā€™t thought of where I do have a table with clickable properties, but clicking that table to impact other invisible repeaters does the trick nicely and just using those repeatersā€™ values technically works. Storing It then works at the instant that I need them to be created/changed. It does create an excess of repeaters for each modification, but it does work.

Thanks!


#5

Basically, Iā€™m trying to have a single repeater with the actual contents that would need to be changed or updated in the future in a single repeater whereas my coworkers would not need to understand the underlying conditions in depth to maintain the prototype after Iā€™m done. Simply changing the original repeaterā€™s values in the table would make all the necessary modifications through conditions so the team wouldnā€™t have to worry about making updates in the future as opposed to having to manually change 2-3 repeaters of values and manually inserting things like a ā€œMoreā€ button (item) that changes based on the width of the screen and then having to delete that value so it can be linked to sub branch navigations that connect to this upper level. The more item Iā€™ve placed using sort based on the width. I was just hoping to be able to delete this item or another item within a repeaterā€™s OnItemLoad or OnLoad to then connect directly to the navigations that are dependent on this one (More does not have its own corresponding values by the way for in depth navigations of this repeaterā€™s items and so it should be deleted and the secondary navs should share a common column with the other nav and so More would have to deleted for this to work). This is kind of the gist of why I was trying to do this.


#6

Wowā€¦okā€¦

I guess without seeing exactly what youā€™re doing, I wonā€™t be much more help. It sounds like you were able to find a workable solution so I hope that works for you. Good luck!