Proble Bulk Edit with ID Editable

QuestionsProble Bulk Edit with ID Editable
Thales Facó asked 5 years ago

Hello!

 

I have a problem mixing bulk edit and event on_after_update.

I need to put my ID editable if I want the event on_after_update  works properly when I use FORM EDIT. Inline workd perfect, because ID is active.

But when I use Bulk Edit, the ID do not coming on the array $data.

 

Follow my part code:

 

$e=array();
$e[“on_after_update”] = array(“autostatus”, null, true);
$g->set_events($e);

$col = array();
$col[“title”] = “ID”;
$col[“name”] = “ID_AUDIENCIA”;
$col[“width”] = “58”;
$myfieldval = $col[“name”];
$myfieldnam = $col[“title”];
$Primaria = $col[“name”];
$col[“editable”] = true; //I use this beacause ON_AFTER_UPDATE workd properly using form
$col[“editrules”] = array(“readonly”=>true);
$cols[] = $col;

 

function autostatus($data)
{
//conexão manual.
include_once(“../../config.php”);

$conn = mysqli_connect(PHPGRID_DBHOST, PHPGRID_DBUSER, PHPGRID_DBPASS, PHPGRID_DBNAME);
$resuli = mysqli_query($conn, “UPDATE AUDIENCIA SET FK_STATUS = 2 WHERE DTFIM > ‘2019-01-01’ AND DTFIM IS NOT NULL AND ID_AUDIENCIA IN(“.$data[‘params’][‘ID_AUDIENCIA’].”)”);
$resuli = mysqli_query($conn, “UPDATE AUDIENCIA SET FK_STATUS = 16 WHERE FK_STATUS IN(1,4,16) AND (FK_ADVCONTRATADO <> 0 AND FK_ADVCONTRATADO IS NOT NULL) AND (DTFIM < ‘2019-01-01’ OR DTFIM IS NULL )AND ID_AUDIENCIA IN(“.$data[‘params’][‘ID_AUDIENCIA’].”)”);

}

Can you undesrtand me?

2 Answers
Abu Ghufran Staff answered 5 years ago

Hello,

Yes, i understand. This issue is fixed now. I’ll be sending you update.

To get selected IDs in callback, you need to access it by:

$data[‘ID_AUDIENCIA’] – without [“params”]

You can always debug $data by putting phpgrid_error($data) at start of callback function.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Thales Facó answered 5 years ago

Thank you!

Everything is ok!

Perfect Support!

Your Answer

18 + 14 =

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?