:: Forum >>

Dynamically Adding Rows

How do I dynamically add rows to a table? I have a logger which dumps the data into a 2D array (renderable as a table). However this array is ever growing, and after the AWGrid table has been built, I want to add rows to it with the additional data now found in the 2D array.

Ideally I want to poke a "rowAdded()" function which calls the existing methods for pulling cell data - or even better, a "addRow(dataField0,dataField1...)" function to add a row with the data provided.

I would actually much prefer a table which I could generate the column headers for and manually add the rows to.

Any ideas as to how to accomplish this? Binning the table control and rebuilding it each time is getting very very slugish when there are more than 50 rows!
Dan Hardiker
Friday, March 4, 2005
I have found the following code (search doesnt work to well when looking for "add", but I found it when putting in "delete"?!).

Unfortuantly the code refreshed ALL the items in the table. Not good, as it starts to take 10+ seconds to refresh with 100 items ... can it not just add items to the pre-exisitng dom?

function new_row()
obj.setRowProperty("count", obj.getRowProperty("count") + 1);
myData[myData.length] = ["", "", ... ,""];
<a href="javascript:new_row()">New Row</a>

Any ideas?
Dan Hardiker
Friday, March 4, 2005
I'm VERY interested in this answer, as well. I have not used Active Widgets yet, but am contemplating doing so. If so, I must have this feature -- and I would like it to not take too long.
Steve Ruegsegger
Thursday, March 31, 2005
Well, seems as though this forum is not widely supported unlike the browsers ;o)

I, too, need this feature and will lokk into it, and post a solution if/when I find it.
Psilo [at] Cyberspacement [dot] com
Friday, May 13, 2005
I don't know
Tuesday, May 24, 2005
Me too...I'm looking fot this feature so I can implement adding multiple values before sending to the server...

Thursday, May 26, 2005

Is there descent way of adding rows dyanmically to an existing grid? I have looked through the form and there doesn't seem to be a straight answer. Again, I do not want to refresh the whole grid after adding few rows.

One possible solution/(illustion of adding rows) is to
have a simple HTML table and dynamically create rows in the table.
In each row created, insert a grid there (hiding the scroll bars and headers). Leave the header for only the top grid.

Is there a better way?
Thursday, September 8, 2005

This topic is archived.

Back to support forum

Forum search