Inserting image in grid view when the uploaded file is not an image

micben

New member
Hello !

1) the checkboxes on the grid view are only used to delete specific records, no? I have tried to used them to select and get the corresponding CSV file but this is no meant to result that way, I presume.

2) I try to display a default thumbnail, at least in the grid view, when the extension of an uploaded file IS NOT jpg, gif or png.

I guess I should insert something like this in the custom functions:

function dadabik_defaultpic($parameters_ar){

$($parameters_ar['PhotoA']).error(function(){
$(this).attr('src', 'NoImage.png');
}

The field name is PhotoA.
The default image name is NoImage.png (already inserted among all uploaded images)
The function would be added in the formatting function parameter of this field.

BUT it causes a syntax error preventing the whole table to work. In fact, it refers to a syntax error on a custom functions line where there is nothing written. I had to restore the old custom functions file, to flush the cache etc.

Do you see any change needed on this new code, above? Thanks !!

Using DaDaBIK version 10.6-Manarola enterprise, installed on 02-01-2021 (installation code: 12070587638846ce96), the latest version of DaDaBIK is 10.6-Manarola released on 01-26-2021

You are runnning the latest release of DaDaBIK

In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enteprise to Platinum) please contact us.

System info
PHP Version: 7.1.33

mysql version: 5.7.32-35-log

Web server: Apache

Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36
 

chrisj

New member
Hello,
I am responding/supporting your Number 1 about the checkboxes, and also presume it is for delete only. Further, i would like to:
1. Have a Select All link to choose all of the visible rows in the grid
2. Be able to update one or more fields for the items that are checked with a static value, or even a calculated value. I know this can be done with an SQL UPDATE query, but would I need to write a function to do this?

I have just purchased, and would like to see how much this can be customized.

Regards,
Chris
 
To chrisj:
If you have Enterprise/Platinum, you can add custom buttons which can reference the array of record IDs where the box is checked.
After doing sanity checks, you can then run your SQL query.
In the manual, under "10.7. Custom buttons" see the section "Custom buttons and records selected by checkboxes".
 
Top