Bulk Edit doesn't work for my table

QuestionsBulk Edit doesn't work for my table
Chisum asked 3 years ago

I turned on debug mode to try to determine why.

mysqli): SELECT * FROM my_table WHERE 1=1 LIMIT 1 OFFSET 0

(mysqli): UPDATE my_table SET `product_id`=”,`warehouse_id`=”,`qty`=’1′,`available_qty`=”,`ship_qty`=”,`room_shelf`=”,`cost`=”,`sale`=”,`backorders`=”,`stock_status`=” WHERE `item_id` IN (”)


This is the data sent with the request:















And here is the php setup:

$g = new jqgrid($db_conf);
$g->con->debug = 0;
$g->table = “my_table”;

$opt[“multiselect”] = true;

“autofilter” => true,
“search” => “simple”,
“inlineadd” => true,
“showhidecolumns” => true

$out = $g->render(“list1”);


It seems to send the right ids, but not put them in the IN condition as it should, it also seems like it will wipe out rather than ignore the blank field values which is not good at all.  I saw to attach code via gist but I don’t have a github account and don’t wish for one.

2 Answers
chisum answered 3 years ago

Not an answer but an update, i managed to get it to work with this php code but it’s not ideal since it basically rewrote the entire update process.  I included some basic calcs I need too but ya.  I’d like to not have to write custom update queries for every grid I make and wonder why it doesn’t work out of the box.  Thanks.

$e[“on_update”] = array(“update_client”, null, true);
function update_client(&$data) {
if(!empty($_REQUEST[‘id’]) && $_REQUEST[‘oper’]==’edit’){
$item_ids = explode(“,”,$_REQUEST[‘id’]);
$params = [];
foreach($_POST as $k=>$v){
if(!empty($v) && $k!=’oper’ && $k!=’id’) $params[$k]=$v;
$setstr = ”;
foreach($params as $k=>$v){
$setstr = rtrim($setstr,”,”);
foreach($item_ids as $item_id){
$row = qone(“select * from my_table where item_id=$item_id”);
$avail_qty = $params[‘qty’] – $row[‘ship_qty’];
qup(“update my_table set $setstr where item_id=$item_id”);
else {
#$row = qone(“select * from my_table where item_id=$data[item_id]”);
$data[“params”][“available_qty”] = $data[‘params’][‘qty’] – $row[‘ship_qty’];

Abu Ghufran Staff answered 3 years ago

I’ve also emailed you latest build that should solve it.

Abu Ghufran - Dev Team
Grid 4 PHP Framework
Your Answer

18 + 9 =

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?