Is there an easy way to add multiple rows at one time in the grid? I know it sounds funny but I have a customer that wants four rows added simultaneously from the add button. They would be empty rows, but the customer wants this ability. Any thoughts?
Thanks,
Bruce Rick
Hello Bruce,
You can do it using on_insert method with function so:
// this db table will be used for add,edit,delete
$h->table = "My table";
$e["on_insert"] = array("insert_data", null, true);
$h->set_events($e);
//Then call function insert_data for on_insert method.
function insert_data($data)
{
$data["params"]["col1"];
unset($data["params"]["col2"]); //If you donĀ“t wants save nothing in this col
$data["params"]["col3"] = 0; //If you wants 0 for this
$data["params"]["col4"] = ""; /If you wants empty for this
}
Regards!
You can also review this demo:
Live: http://www.phpgrid.org/demo/demos/appearance/excel-blank-rows.php
Code: http://www.phpgrid.org/demo/demos/appearance/excel-blank-rows.phps