SHOW:
|
|
- or go back to the newest paste.
| 1 | $g = new jqgrid(); | |
| 2 | ||
| 3 | // file upload column | |
| 4 | $col = array(); | |
| 5 | $col["title"] = "Image"; | |
| 6 | $col["name"] = "news_image"; | |
| 7 | $col["editable"] = true; | |
| 8 | $col["edittype"] = "file"; // render as file | |
| 9 | $col["upload_dir"] = "uploads/news_images"; // upload here | |
| 10 | $col["show"] = array("list"=>false,"edit"=>true,"add"=>true); // only show in add/edit dialog
| |
| 11 | $cols[] = $col; | |
| 12 | ||
| 13 | ||
| 14 | $col = array(); | |
| 15 | $col["title"] = "Image Preview"; | |
| 16 | $col["name"] = "image"; | |
| 17 | $col["formatter"] = "image"; | |
| 18 | $col["formatoptions"] = array("class"=>'img_preview');
| |
| 19 | $col["search"] = false; | |
| 20 | $col["show"] = array("list"=>true,"edit"=>true,"add"=>false); // Tried this trick to show Preview in Edit Popup
| |
| 21 | $cols[] = $col; |