I don't know the exact syntax and class names off the top of my head. But your itemlist is an array, and the cursor index tells you what position you are in. The thing to remember with index positions is that the first element is 0. Second item is 1 and so forth...
array = [item1, item2, item3]
cursorIndex = 0
array[cursorIndex] #=> item1
So you want to do something like...
newVar = array[cursorIndex].id #=> newVar = item1.id