I can't see image column on the grid.
I wrote this :$col["show"] is array and almost true
My code is here:
// file upload column
$col = array();
$col["title"] = "Image";
$col["name"] = "image";
$col["width"] = "50";
$col["align"] = "left";
$col["edittype"] = "file";
$col["editable"] = true;
$col["search"] = false;
$col["upload_dir"] = "../uploads/suppliers"; // upload here
$col["sortable"] = false;
$col["align"] = "center";
$col["formatter"] = "function(cellval,options,rowdata){ return '<img src=\"'+cellval+'\" height=60 />'; }";
$col["unformat"] = "function(cellval,options,cell){ return $('img', cell).attr('src'); }";
$col["editrules"]["allowedext"] = "png,gif,bmp,jpeg,jpg,doc,xls,docx,xlsx"; // comma separated list of extensions
$col["editrules"]["allowedsize"] = 3 * 1024 * 1024; // allowed size in bytes e.g. 3 MB = 3 x 1024 x 1024
$col["show"] = array("list"=>true,"edit"=>true,"add"=>true,"view"=>true);
$cols[] = $col;
1 Answers
Your Answer

