3.2.0

Add new row in the table

i´d like to add a new line in the table. By pressing a button or else.

witch is the best way to do ?
Philipp
August 18,
I have a solution for my Problem...
<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>


Philipp
Philipp
August 18,
There are many problem in suggested solution. Try sorting column before add/delete - grid will crash.

try seeing this example - http://thej2ee.com/awdemo/examples/myexamples/add_edit_delete_rows.html

here i've included everything required to do add/delete/edit. do check the function obj.resetRowValues(), which clears the internal variables used by grid...
Sudhaker Raj
August 20,
Sudhaker: Your example doesn't work on firefox and crashes after column sort in IE.
Any ideas?
Sergio
August 30,
help me in this regard,

how can we identify a row or a element dynamically by clicking the row or the column of the row.
balakrishna
April 15,
This works for me: (I'm using a JavaScript array for the data, which are represented as strings)

// get selected row index
var rownum = obj.getSelectionProperty("index");

//get first element of selected row
var pkey = obj.getProperty("data/text", rownum, 0);
D. Cooke
April 15,

This topic is archived.

See also:


Back to support forum