:: Forum >>
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
Wednesday, August 18, 2004
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
Wednesday, August 18, 2004
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
Friday, August 20, 2004
Sudhaker: Your example doesn't work on firefox and crashes after column sort in IE.
Any ideas?
Sergio
Monday, August 30, 2004
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
Friday, April 15, 2005
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
Friday, April 15, 2005
This topic is archived.
Back to support forum
Forum search