Listicongadget and clicking on it
Listicongadget and clicking on it
Can anyone tell me, how i can detect clicks on listicongadget cell, also on column header?
I have to know in witch column click was made and in what column header click was made.
Thanks
Karu
I have to know in witch column click was made and in what column header click was made.
Thanks
Karu
Re: Listicongadget and clicking on it
you can use BindCellClick() from my ListIconGadgetEx-Module: https://github.com/spiderbytes/ListIconGadgetEx
Example:
Greetings ... Peter
Example:
Code: Select all
IncludeFile "ListIconGadgetEx.sbi"
EnableExplicit
Enumeration
#Window
#ListIconGadget
EndEnumeration
Procedure CellClick(ListIconGadget, Column, Row)
Debug "CellClick():"
Debug "Column: " + Str(Column)
If Row = -1
Debug "Row: Header"
Else
Debug "Row: " + Str(Row)
EndIf
Debug "------------------"
EndProcedure
OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 800, 800, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(#ListIconGadget, 0, 0, 800, 800, "Name", 300, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(#ListIconGadget, 1, "Address", 400)
ListIconGadgetEx::SetOddRowColor ("lightgreen", "darkgreen", "black", "white")
ListIconGadgetEx::SetEvenRowColor("white", "lightblue", "black", "black")
ListIconGadgetEx::SetRowHeight(#ListIconGadget, 36)
ListIconGadgetEx::BindCellClick(#ListIconGadget, @CellClick())
Define Counter
For Counter = 0 To 9
AddGadgetItem(#ListIconGadget, -1, "Name" + Counter + #LF$ + "Address" + Counter)
Next
Re: Listicongadget and clicking on it
Hello, Peter,
I just stumbled over your handy ListIconGadgetEx module and I can use it right now. Many thanks for it!
A short question: There is no function UnBindCellClick() in the module. Is it not necessary or did you just not add it?
Markus
I just stumbled over your handy ListIconGadgetEx module and I can use it right now. Many thanks for it!
A short question: There is no function UnBindCellClick() in the module. Is it not necessary or did you just not add it?
Markus
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: Listicongadget and clicking on it
Peter,
can you tell me what I need to change in your module to also provide the header with the new Rowheight?
Currently only the rows below are adjusted in height.
I tried to include a padding-top padding-bottom in the class dgrid-header, but the data rows below are not moved further down.
Unfortunately, I still don't have the time to learn more about this topic. I really hope that Fred decides to implement a good web GUI library. The many small JS adjustments you have to make manually on gadgets and the program interface under Spiderbasic to make it look more or less presentable are... how do you say in english? A pain in the ass.
Greetings Markus
can you tell me what I need to change in your module to also provide the header with the new Rowheight?
Currently only the rows below are adjusted in height.
Code: Select all
Procedure SetRowHeight(ListIconGadget, RowHeight)
GetGrid
! spider.DojoAspect.after( grid, 'renderRow', function( row, args ) {
! var div = $(row).find("td.dgrid-cell").find("div").find("div");
! div.css('height', v_rowheight + 'px');
! div.css('line-height', v_rowheight + 'px');
! return row;
! });
EndProcedure
I tried to include a padding-top padding-bottom in the class dgrid-header, but the data rows below are not moved further down.
Unfortunately, I still don't have the time to learn more about this topic. I really hope that Fred decides to implement a good web GUI library. The many small JS adjustments you have to make manually on gadgets and the program interface under Spiderbasic to make it look more or less presentable are... how do you say in english? A pain in the ass.
Greetings Markus
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: Listicongadget and clicking on it
kurzer wrote:UnBindCellClick()
Added: UnbindCellClick(ListIconGadget)kurzer wrote:provide the header with the new Rowheight
Added: SetHeaderHeight(ListIconGadget, HeaderHeight)
https://github.com/spiderbytes/ListIconGadgetEx
Greetings ... Peter
Re: Listicongadget and clicking on it
Peter! YEEEEEEESSSS! Thank you.
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: Listicongadget and clicking on it
you're welcome.
I have just uploaded a new version with an experimental sorting functionality. You are invited to try it out.
I have just uploaded a new version with an experimental sorting functionality. You are invited to try it out.
Re: Listicongadget and clicking on it
For your information:
I was happy a bit too early, because in my project your HeaderHeight extension just did not work.
After some research I found out that the following code resets the headerheight. The height of the data rows below is not affected.
At the moment I just change the header height every time I change the column width. This works quite well.
Markus
I was happy a bit too early, because in my project your HeaderHeight extension just did not work.
After some research I found out that the following code resets the headerheight. The height of the data rows below is not affected.
Code: Select all
SetGadgetItemAttribute(#ListIconGadget3, 0, #PB_ListIcon_ColumnWidth, 100, 1)
Markus
SB 2.32 x86, Browser: Iron Portable V. 88.0.4500.0 (Chromium based), User age in 2023: 55y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
Re: Listicongadget and clicking on it
Fixed. Should work now.kurzer wrote:After some research I found out that the following code resets the headerheight.