Table Row Selection

35 views
Skip to first unread message

Anthony Mitchell

unread,
Jun 2, 2017, 1:58:09 PM6/2/17
to gowebuitoolkit
Hi,

Firstly I'm new to gowut and have no html experience (my background is in embedded computing) so apologies if this is a basic newbie question and for the following rather long description

I'm using go/gowut on an embedded ARM linux project to provide the device with a web accessible configuration/status page

I'm using a number of (nested) tables to present the configuration data to the user (see my rough proof of concept below)

I don't want the user to edit the configuration data directly (i.e. through cells containing text or list boxes) so the table only contains labels (and a button). Once a row is selected I populate a separate panel of components for them to do the actual editing.

So far everything is working OK - I'm adding labels to the cells and handling the label mouse over and click events to give me my row selection (through CompIdx on the event src)

The one problem I have is getting the label to be the same size as the cell (rather than the size of the text it contains) - this is leaving me with large gaps in my rows where I can't click or mouse over - I have to click directly on the label for this to work.

So, to the question - Can anyone tell me how I re-size a label to fit the cell or alternatively suggest another way to do row selection?






Auto Generated Inline Image 1

András Belicza

unread,
Jun 2, 2017, 4:51:00 PM6/2/17
to Anthony Mitchell, gowebuitoolkit
Check out the Showcase of Features example app here:


It has a "menu" on the left side, each menu item opens / renders a demo on the right side. Each menu item is clickable in the whole cell.

It's source can be found inside the project. That menu is built in this flie:





link := gwu.NewLabel(name)
link.Style().SetFullWidth().SetCursor(gwu.CursorPointer).SetDisplay(gwu.DisplayBlock).SetColor(gwu.ClrBlue)


As you can see, it is achieved by simply calling link.Style.SetFullWidth(), which will make the component occupy all the available space, in your case the full table cell.

That should simply do it in your case too.

Regards,
Andras

Reply all
Reply to author
Forward
0 new messages