Clone row Archives | phpGrid - PHP Datagrid Create PHP grids in minutes, not hours. Fri, 29 Nov 2024 23:53:29 +0000 en-US hourly 1 CodeProjecthttps://wordpress.org/?v=7.0.3 129966043 Copy Row https://phpgrid.com/example/copy-row/ Sat, 28 May 2016 09:12:48 +0000 http://phpgrid.com/?p=8990   You can now clone a row by simply calling “enable_copyrow()” function. Once it’s enabled, select a row and then in “Copy Row” button in the footer. It will duplicate the selected row in the database table and even return the auto-incremented ID. 123// Always include namespace and conf.php on TOP of the script. use […]

The post Copy Row appeared first on phpGrid - PHP Datagrid.

]]>
phpgrid_copyrow

 

You can now clone a row by simply calling “enable_copyrow()” function. Once it’s enabled, select a row and then in “Copy Row” button in the footer. It will duplicate the selected row in the database table and even return the auto-incremented ID.

1
2
3
// Always include namespace and conf.php on TOP of the script.
use phpCtrl\C_DataGrid;
require_once("/file/path/to/conf.php");

Note that this feature requires the primary key is an auto-increment type.

1
2
3
4
$dg = new C_DataGrid("SELECT `orderNumber`, `orderDate`, `requiredDate`, `shippedDate`, `status`, `comments`, `customerNumber` FROM `orders`", "`orderNumber`", "orders");
$dg -> enable_edit("FORM", "CRUD");
$dg -> enable_copyrow(true);
$dg -> display();

Launch Copy Row Demo!

The post Copy Row appeared first on phpGrid - PHP Datagrid.

]]>
8990