[Gambas-user] Event WebTable.Click
Bruce Steers
bsteers4 at gmail.com
Thu Mar 2 17:48:53 CET 2023
On Thu, 2 Mar 2023 at 16:08, Mayost Sharon <sharon at 455.co.il> wrote:
> Hello
>
> I know it's just for show
> but
> While I fill the cell with the button
> data.control=WebButton
> So when I click on the button that is in a certain cell I get an event of:
> WebTable1_Click(Row As Integer, Column As Integer)
> Then I can know from which row and which column the button is pressed
> And it provides me with information on how to access a database to
> retrieve the information I need
showing the button text in the example code we have been using the text
showed
Button:1_1 for row 1 column 1
Button:2_1 for row 2 column 1
(there is row/col identity there)
You can also use the button.Name to give a unique name stating Row/column
while having same button text on all buttons.
Also button.Tag
So of course you can tell what button was clicked from what row./col,
by smart naming as your code has done all along..
Public Sub WebTable1_Data(Row As Integer, Column As Integer, Data As
WebTableData)
Select Case Column
Case 0
Data.Background = Color.SetAlpha(Color.Yellow, 192)
Data.Text = "Data: " & CString(Row) & "_" & CString(Column)
Case 1
Dim wb As WebButton = New WebButton(Me) As "BUT"
wb.Text = "DangerButton"
wb.Name = "btnDanger_" & CString(Row) & "_" & CString(Column)
wb.Class = "button is-danger"
Data.Control = wb
End Select
End
Public Sub BUT_Click()
Dim iRow, iCol as Integer
iRow = Split(Last.Text, "_")[1]
iCol = Split(Last.Text, "_")[2]
End
> The problem is that it only works with a button
> If I fill the cell with a check box
> It does not respond to a click event
>
Oh it has lots of problems if you want to make it do more than it has been
designed for.
I don't get why you even need it as there are plenty of ways to keep track
of the buttons row/col data. As mentioned above.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230302/d18c9c65/attachment.htm>
More information about the User
mailing list