Move list items up and down using buttons

0
Hey everyone, I want to move items in a list view either up or down in a list from their current position. Ive been stuck on this problem for a few days now. Is there any way this could be done? Best, Bryan
asked
1 answers
7

Bryan,

You can do this using either a microflow or nanoflow button.  Add a ‘sequence’ attribute to your entity – an integer will work.  Before opening a page with the Listview, set this attribute to the initial sequence you want to use.  Have your listview sort by the sequence attribute.  Now if you want to use a button to change the sequence, create a nanoflow or microflow that has one parameter which is the listview entity.  If you want to move the object up, select the object with the prior sequence and change the sequence of the passed in object and the prior object.  You’ll have to account for the object being at the top of the list (i.e. if there is no object with the sequence before the one passed in, don’t change the sequence of the passed in object, etc.)

Hope that helps,

Mike

answered