incoronado
Posts: 12
|
| Posted: 08/31/2010, 4:19 PM |
|
Is there a way to create a duplicate a row in an editable grid?
|
 |
 |
mamboBROWN
Posts: 1713
|
| Posted: 08/31/2010, 6:44 PM |
|
incoronado,
Are you asking for a way to add another empty row to the editable grid?
|
 |
 |
incoronado
Posts: 12
|
| Posted: 09/01/2010, 2:47 PM |
|
Yes.
This is more-or-less what I was thinking... If you look at the example link below it has a button to add a row, but it adds a blank row. I want to add a row, but copy data from an existing row. This particular example is all client side until you submit the request. I doesn't necessarily have to be client side, but I prefer it because it is faster and doesn't create as many requests.
http://examples.codecharge.com/ExamplePack/EditableGrid...idAddButton.php
|
 |
 |
andy
Posts: 183
|
| Posted: 09/02/2010, 9:04 AM |
|
You can use BeforeBuildInsert events to set default values but this is server side.
To do it client side, you will have to assign values to the fields using javascript and the tricky bit is adding these values to the correct (new) row.
Here is a javascript example of how this might work:
variable1 = document.getElementById("fieldname1_"+row_id).value;
Remember to add the underscore after the fieldname as the browser identifies each field in the grid by appending "_rownumber"
e.g. surname_1
You will have to get the maximum number of rows in order to work out the new rownumber value.
_________________
Andy
RAD tools for rich UI controls:
http://www.koolphptools.com |
 |
 |
|