ListOptions Rendered event Ajax

Hi,
I use V12, I make the option “Add in bookmarks”

  1. The button "Add"function ListOptions_Rendered() {
    $be = "<a href="#" onclick="return ew_SubmitAction(event, {action: ‘gobook’, method: ‘ajax’, msg: ‘Add in bookmark?’, key: " . $this->KeyToJson() . “});">Add”;
    $this->ListOptions->Items[“new”]->Body = $be;
    }

I have button

  1. If i clicked “Add”, i see modal window with confirm options
    After confirm loaded in modal all my page, and button “ok”// Row Custom Action event
    function Row_CustomAction($action, $row) {
// Return FALSE to abort

if ($action == “gobook”) { // Check action name
ew_Execute(“INSERT INTO account_manag_languages (profiles_id, id_language_pair) VALUES (”.CurrentUserID().“, " . $row[“id”].”)");
return TRUE; // Success
}

I click “ok”
And Nothing … result is emptyHow can i looking massif $row ?

Are you sure the following SQL produces the right result?“INSERT INTO account_manag_languages (profiles_id, id_language_pair) VALUES (”.CurrentUserID().“, " . $row[“id”].”)“Try to display it using setSuccessMessage method that belongs to the page to make sure it contains the valid value:$this->setSuccessMessage(“INSERT INTO account_manag_languages (profiles_id, id_language_pair) VALUES (”.CurrentUserID().”, " . $row[“id”].“)”);

// Row Custom Action event
function Row_CustomAction($action, $row) {

	// Return FALSE to abort

if ($action == “gobook”) { // Check action name
ew_Execute(“INSERT INTO account_manag_languages (profiles_id, id_language_pair) VALUES (”.CurrentUserID().“, " . $row[“id”].”)“);
$this->setSuccessMessage(“INSERT INTO account_manag_languages (profiles_id, id_language_pair) VALUES (”.CurrentUserID().”, " . $row[“id”].“)”);
var_dump($row);
return TRUE; // Success
}
}Is empty. Where is it display ?

Try to remove this code:
ew_Execute(“INSERT INTO account_manag_languages (profiles_id, id_language_pair) VALUES (”.CurrentUserID().“, " . $row[“id”].”)");

I solved this problem
Updated php 5.6
I put a checkbox in the settings table Primary Key
Now it is working as I wanted
Thank you!How change style of button (active/not active) after Ajax function?Ajax refresh or … ??

i need will show “new status” for a record.
How can i get result from function ew_SubmitAction() after change status without refresh the page?
The Status is visible after a refresh only.

You can define a callback function as paramter of the ew_SubmitAction() and use this function to update the status.You can refer to the the definition of the we_SubmitAction() in ewp12.js to get more information.

The SolutionAdd Class
$bookmark = “<a class=‘btn btn-default ewRowLink btn-sm’ title=‘Remove from bookmark’ href="#" id="bookmark”.$this->id->CurrentValue.“" onclick="$('a#bookmark”.$this->id->CurrentValue." i’).removeClass(‘gray’); return ew_SubmitAction(event, {action: ‘star_remove’, method: ‘ajax’, msg: ‘Remove from bookmark?’, key: " . $this->KeyToJson() . “});">”;

Remove Class
$bookmark = “<a class=‘btn btn-default ewRowLink btn-sm’ title=‘Add in bookmark’ href="#" id="bookmark”.$this->id->CurrentValue.“" onclick="$('a#bookmark”.$this->id->CurrentValue." i’).addClass(‘gray’); return ew_SubmitAction(event, {action: ‘star’, method: ‘ajax’, key: " . $this->KeyToJson() . “});">”;But, how disable a modal window in this options?

i have a problem with ew_SubmitAction the action is not detected.
this is the line in ListOption_Rendered:

if($this->ceck->CurrentValue==“0”)
{
$be = “<a href="#" onclick="return ew_SubmitAction(event,{action: ‘star’,method: ‘ajax’,msg: ‘Conf?’,key: “.$this->KeyToJson().”,success: ricaricaLista});">Convalida”;
$this->ListOptions->Items[“conv”]->Body = $be;
}else{
$this->ListOptions[“conv”]->Body=“Valido”;
}


this is the line in Row_customerAction:

if($action==“star”)
{
$rsnew=[“ceck”=>“1”];
$result=$this->Update($rsnew);
$this->setSuccessMessage(“Convalidato”);
//Conn.Execute(“UPDATE presenze SET ceck = ‘1’ WHERE ID=”.$row(“ID”) ); // Assume the field ID is of integer type
}

where’s the problem?

It seems you have not defined the “star” action from “Page_Load” server event of that List Page. So, make sure you have already defined it in “Page_Load” server event.

I don’t think you need to write the code in “ListOptions_Rendered” server event to define that “star” action, since “Row_CustomAction” event will related to “Page_Load” server event only.