Show Delete button and allow deletes Default: Clicking on the button will ask for confirmation from the user if Javascript is enabled on the browser.
The icon can be modified. It is configured in the language class $lens->lang->iconDel.
Also requires the keyTable and keyCol properties to be defined.
If you want only selected rows to be deletable, you can define an additional column called "_CANDELETE_" and set the value to 0 or 1. Non-zero values means that the row can be deleted. This is available since 2.2.0.
For example, set $lens->sql to the following if you want the user to only be able to delete products that begin with 'A' (assuming your database supports CASE)
SELECT productname, supplier, unitinstock, unitprice,
CASE
WHEN substr(productname,1,1) = 'A' THEN 1
ELSE 0
END "_CANDELETE_"
FROM productsSyntax
$lens->canDelete = Boolean; Basic:Yes Advanced/Enterprise:Yes DynamicEdit:Yes [Version 1.0]
|