3.2.0

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
March 4,
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?

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

Any ideas?
Dan Hardiker
March 4,
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
March 31,
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
May 13,
I don't know
Vini
May 24,
Me too...I'm looking fot this feature so I can implement adding multiple values before sending to the server...

Matutek
May 26,
Hello,

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?
Jason
September 8,

This topic is archived.

See also:


Back to support forum