How can i load data from one database table using grid, get this data plus one extra params and insert each record into a DB table using a custom button on one of the column
$col = array();
$col["title"] = "Register";
$col["name"] = "reg_status";
$col["width"] = "30";
$col["align"] = "center";
$col["search"] = false;
$col["sortable"] = false;
# no new line in this html, only space. otherwise it may break ui of grid
$buttons_html = "<input type='button' id= 'reg_btn' value='Register' onclick='add_client(this)'>";
$col["default"] = $buttons_html;
$cols[] = $col;
I want onclick Register button, it inserts the record within that row into a db table different from the one data was fetched from
On this click event, you can pass the ID (pk) of this row using ajax call to a php script.
And in that script, do custom insert working.
You can pass the row data using {col-name} placeholder. e.g.
$buttons_html = "<input type='button' id= 'reg_btn' value='Register' onclick='add_client({ID})'>";
where 'ID' is your grid $col["name"] (case sensitive).