Roller - Disabling the rolling!

Looking to improve my search results page that may return 100+ results…

I want to add buttons for <Next 10 results> and <Previous 10 results> to navigate and a click to select the row item.

Questions…
A. Can I disable the rolling on the roller?
B. Can I show no line on the roller as the selected item (so nothing highlighted in blue)

Maybe a list is a better choice for this?

You do lose the infinite scrolling if you switch to a list (just as a heads up). Also, lists consume more memory per item than rollers.

OK so to check i understand what you are suggesting…

Add each search result as a button in my list.
Styled to look less like buttons and more like search results…

Correct?

To populate the list is there a ‘list_set_options’ command similar to when creating the options in a dropdown?

1 Like

See https://docs.littlevgl.com/en/html/object-types/list.html#add-buttons.

Is there something like
lv_ddlist_get_selected_str
or
lv_roller_get_selected_str
to return the text on the button in the list that has been clicked??

My list shows up to 50 search results and changes every time so I can’t imagine having a separate event handler on each button running lv_list_get_btn_text would work for me…

From the link I sent you in the last post:

You can use lv_list_get_btn_label(list_btn) and lv_list_get_btn_img(list_btn) to get the label and the image of a list button. You can get the text directly with lv_list_get_btn_text(list_btn) .

1 Like

I’m an eejit.
Alright people, remember to use.
lv_list_get_btn_text(obj)
not
lv_list_get_btn_text(listbtn)

Thanks for your patience embeddedt, it is oh so appreciated.