CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Duplicate row in editable grid

Print topic Send  topic

Author Message
incoronado

Posts: 12
Posted: 08/31/2010, 4:19 PM

Is there a way to create a duplicate a row in an editable grid?
View profile  Send private message
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?
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.