$data array changed in Phpgrid v2

Questions$data array changed in Phpgrid v2
Patricia Lawson asked 8 years ago

Using phpgrid v1, the $data array passed to a custom function when editing a record contained columns that were hidden on the grid, and hidden in the edit form.

Using phpgrid v2, the $data array no longer includes these extra columns. How can I get data from the row that is not displayed in the add/edit form?

Thanks

6 Answers
Abu Ghufran answered 8 years ago

You can edit lib/inc/jqgrid_dist.php and replace (2 occurrences):

'jQuery("#tr_'.$c["index"].'",formid).remove();';

with

'jQuery("#tr_'.$c["index"].'",formid).hide();';

We're working on this bug and will be merged on main line after qa.

Patricia Lawson answered 8 years ago

Ok, good. I was worried for a moment there…
Any ETA?

Abu Ghufran answered 8 years ago

Please see JS error console log of browser debugger (f12)
It would tell exact error details. Paste it so i can debug further.

Patricia Lawson answered 8 years ago

With the above change, Abu, when I click Submit the submit button changes color and then hangs. If I cancel and refresh my grid, the edit has occurred.
Same with Add: form hangs, but closing and refreshing the grid shows the newly added row.
thanks

Patricia Lawson answered 8 years ago

It appears I had a different problem in my grid setup that I didn't notice. I used the export=>true instead of export_excel=>true, which seems to be a change in v2. I overlooked that in this file, but now that it is corrected, I can add and edit as usual.

Thanks – all is OK now.

Patricia answered 6 years ago

It has been a while since I have seen this problem. I am using jqgrid_dist.php v2.1.2 build 20160725-0106
I changed as advised above:
‘jQuery(“#tr_’.$c[“index”].'”,formid).remove();’;
with
‘jQuery(“#tr_’.$c[“index”].'”,formid).hide();’;
 
Hidden columns are still not passed in the $data array.  My column looks like this:
$col = array();
$col[“name”] = “make_id”;
$col[‘hidden’] = true;
$cols[] = $col;
I need the make_id to do a db update…
 
Thanks!
 
 

Your Answer

4 + 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?