Add component to table with auto row and column

28 views
Skip to first unread message

ati...@mail.ccsf.edu

unread,
Jul 7, 2018, 10:17:54 PM7/7/18
to gowebuitoolkit
Hello,

I am trying to create an app that uses a table pretty heavily. I cannot find a way to add an element without having to set the column and row. I would like to just click a button and it auto adds an element. I cannot manually modify the row and column programatically. It needs to be dynamic, if I am missing something or there is a way to do this, please let me know.

Thanks!

András Belicza

unread,
Jul 9, 2018, 3:55:06 AM7/9/18
to ati...@mail.ccsf.edu, gowebuitoolkit
gwu.Table has a size (rows and cols), but the size is not fixed after creation.

So if you want to add a new row, simply call Table.EnsureSize() or Table.EnsureCols() to extend it, after which you can call Table.Add() to add the new cells.

Don't forget to call Event.MarkDirty() in your event handler, passing the table to let the client know you changed the table and it needs to be re-rendered.
Reply all
Reply to author
Forward
0 new messages