First off, I have (almost?) no coding knowledge at all.
I'm using buttons to select a previous/ the next row, and am trying to loop the selection when it reaches either end of the list. The next button is working for me; it loops back to the beginning when the selection reaches the last row, but the previous button does not loop at all. How do I select the last row in the list?
Here is my function:
I'm using buttons to select a previous/ the next row, and am trying to loop the selection when it reaches either end of the list. The next button is working for me; it loops back to the beginning when the selection reaches the last row, but the previous button does not loop at all. How do I select the last row in the list?
Here is my function:
Code:
function prevMarble() {
%id = List.getSelectedId();
%maxinlist = List.rowCount(); //isn't working
if (%id > 0)
List.setSelectedById(%id--);
else
List.setSelectedRow(%maxinlist);
updatemarbleobj();
}