When selecting a list item, ensure it is visible
- SparrowhawkMMU
- Posts: 281
- Joined: Wed Aug 19, 2015 3:02 pm
- Location: United Kingdom
When selecting a list item, ensure it is visible
Hi,
Currently, if you use SetGadgetState() to select an item in a list box that is not currently visible (ie further up or down in the list so not in the visible view of the list gadget), it is not scrolled into view
Could this be changed so that even if the row is not visible, it is made visible (brought into focus) when selected programatically
Thanks
Currently, if you use SetGadgetState() to select an item in a list box that is not currently visible (ie further up or down in the list so not in the visible view of the list gadget), it is not scrolled into view
Could this be changed so that even if the row is not visible, it is made visible (brought into focus) when selected programatically
Thanks
Re: When selecting a list item, ensure it is visible
Could you post a small snippet ?
Re: When selecting a list item, ensure it is visible
http://forums.spiderbasic.com/viewtopic ... 1251#p1251Fred wrote:Could you post a small snippet ?
(also for ListViewGadget())
Greetings ... Peter
- SparrowhawkMMU
- Posts: 281
- Joined: Wed Aug 19, 2015 3:02 pm
- Location: United Kingdom
Re: When selecting a list item, ensure it is visible
What he said
Seriously though, if you need more from me, let me know.
Seriously though, if you need more from me, let me know.
Re: When selecting a list item, ensure it is visible
Any progress on this request?
It's really annoying using AddGadgetItem() on a big list and the ListIconGadget resets itself to the beginning every time.
It's really annoying using AddGadgetItem() on a big list and the ListIconGadget resets itself to the beginning every time.
Re: When selecting a list item, ensure it is visible
obviously my code I'm referring to above has been deleted.
For this reason here once again:
For this reason here once again:
Code: Select all
If OpenWindow(0, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListViewGadget(0, 10, 10, 250, 120)
For a = 1 To 12
AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview")
Next
SetGadgetState(0, 10)
EndIf
Re: When selecting a list item, ensure it is visible
Hi Peter,
Your code demonstrated the problem. The item is highlighted but is not in view. You have to scroll down to see the highlighted item.
Your code demonstrated the problem. The item is highlighted but is not in view. You have to scroll down to see the highlighted item.
Re: When selecting a list item, ensure it is visible
Yeah, that was the plan.Paul wrote:Your code demonstrated the problem.
Fred wanted to have a code snippet and now he has it (again).
-
- Posts: 284
- Joined: Fri Sep 22, 2017 7:02 am
Re: When selecting a list item, ensure it is visible
Is there already a solution? Maybe a workaround?
Strangely enough, it works within a larger web project. Unfortunately, I can't reproduce what's the reason it works.
Strangely enough, it works within a larger web project. Unfortunately, I can't reproduce what's the reason it works.
Re: When selecting a list item, ensure it is visible
Dirk Geppert wrote:Maybe a workaround?
Code: Select all
Procedure ScrollIntoView(Gadget)
! if (($(spider_GadgetID(v_gadget).div).find(".dgrid-selected")).length > 0) {
! spider_GadgetID(v_gadget).gadget.scrollTo({x:0,y:$(spider_GadgetID(v_gadget).div).find(".dgrid-selected").position().top})
! }
EndProcedure
If OpenWindow(0, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListViewGadget(0, 10, 10, 250, 120)
For a = 1 To 12
AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview")
Next
SetGadgetState(0, 10)
ScrollIntoView(0)
EndIf