Add Multiple Rows at one time

QuestionsAdd Multiple Rows at one time
Bruce Rick asked 7 years ago

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

2 Answers
C3media answered 7 years ago

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!

Your Answer

17 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?