0

I am using the Eyesis Data Grid Control (http://www.phpclasses.org/package/4951-PHP-Display-data-from-a-database-in-a-sortable-table.html) and would like to add the Delete function as shown in Example 3 (http://www.phpclasses.org/browse/file/25088.html).

The line in the sample code where this is done is:
$x->addStandardControl(EyeDataGrid::STDCTRL_DELETE, "alert('Deleting %Id%')");

How do I change the "alert('Deleting %Id%')" to either a function that deletes the record or a call to another page that does the deleting?

I have tried
$x->addStandardControl(EyeDataGrid::STDCTRL_DELETE, mysql_query(DELETE FROM customer WHERE ID='$ID');
and
$x->addStandardControl(EyeDataGrid::STDCTRL_DELETE, delete_one_record.php);

but both do not work. The grid does not even display using either of the above two lines.

Thanks in advanced.

3
Contributors
3
Replies
24
Views
3 Years
Discussion Span
Last Post by Mike_H
0

In this
$x->addStandardControl(EyeDataGrid::STDCTRL_DELETE, "alert('Deleting %Id%')");
the second parameter is a javascript code.

Try to make a javascript function which call your delete_one_record.php file using Ajax, give this function like a second parameter.

0

Thanks albucurus. You led me down the right path and it is working now.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.