utilize multiupdate code but launch JS script instead

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
sticcino
User
Posts: 1043

utilize multiupdate code but launch JS script instead

Post by sticcino »

have a need for a multi-update function that is like the multiupdate/delete function. I;'d like to take advantage of it since everything is in place already. the only difference is that is it possible to execute a JS function instead of the $this->url ?

the code follows: (v2019)

purpose is to set a stage flag for the selected records.....

Page_Render() {
$options = &$this->OtherOptions;
$option = $options["action"];

    // Add Bulk Complete/to be billed Option
    $item = &$option->add("bulkComplete");
    $myURL = "_CompleteInstallationOrder.php?action=8";
    $item->Body = "<a class=\"ew-action ew-add\" title=\"" . HtmlTitle("Bulk Move To Be Billed.") . "\" data-table=\"assessments_installs\" data-caption=\"" . HtmlTitle("Bulk Complete Selected Items") . "\" href=\"\" onclki=\"ew.submitAction(event,{f:document.fassessments_installslist,url:'" . $myURL . "'});return false;\">" . "Bulk Complete" . "</a>";
    $item->Visible = true;
}

what i would like to do is after the records are selected and they press bulkComplete is to launch a JS function which with ask for confirmation then run my update script via an $.ajax call.

would that be possible or is there other options that I can use that can take advantage of the ew.submitAction function since it would store the selections in a global variable which the above php script would use to do the updates.
or should I copy the submitAction code in the local php file -- get the data then from there launch my JS function to execute the php script.

thoughts....

thanks


arbei
User
Posts: 9429

Post by arbei »

You should put your code in the onclick event before ew.submitAction().


Post Reply