custom update with add value from popup window

Hi please help me, How can i get value in db_update.php from main page with grid where i use this function

function delete_r() { var ind1 = window.prompt('Delete reason', '0'); if (ind1 === null) return; mygrid.deleteSelectedRows(); }

in the db_update.php i use this function

function my_delete($data){ global $conn; $price=$data->get_value("price"); $id=$data->get_value("id"); $desc <-- How get value from popupwindow from main page ????? $conn->sql->query("UPDATE some_table SET price='{$price}',desc='{$desc}' where id={$id}"); $data->success(); //if you have made custom update - mark operation as finished } $conn->event->attach("beforeDelete","my_delete");

How get value $desc from popupwindow from main page ???

If data is not accessible through get_value method, you can set it on client side as

mygrid.setUserData(id, "mydata", "some data"); mygrid.deleteRow(id);

after that on server side you will be able to use

$mydata = $data->get_value("mydata");

did, but it’s not work …

get_value on server side can access

  • id
  • data from all columns of grid
  • userdata assigned to the row

Be sure that you are setting userdata before deleting row

What’s parametr “id” in setUserData(id, “mydata”, “some data”); ??

thx
i use mygrid.setUserData("", “mydata”, “some data”);
and it’s works why ???

id - id of row which will be updated|deleted
If you are not using id - it is counted as global userdata, will be assigned to all rows.

When sending data to server side, dataprocessor will send

  • values from all columns
  • userdata which was assigned directly to this row ( id == some )
  • userdata which was assigned to all rows ( id == “” )