Extra Characters when uploading file.

QuestionsExtra Characters when uploading file.
Greg asked 3 years ago

Hi,

I can upload, delete an edit a file fine, however, when I go to edit the file it shows in the edit window as

a> (and then a delete button).

How do I not show the image there as such?

I have used the code from the demo for this and only changed that I wanted it to be edited.

$col = array();
$col["title"] = "Logo";
$col["name"] = "TAM_LOGO";
$col["width"] = "150";
$col["editable"] = true; // this column is editable
$col["edittype"] = "file"; // render as file
$col["upload_dir"] = "uploads"; // upload here
$col["editrules"] = array("ifexist"=>"error"); // "rename", "override" can also be set
$col["show"] = array("list"=>false,"edit"=>true,"add"=>true); // only show in add/edit dialog
$cols[] = $col;

// get upload folder url for display in grid — change it as per your upload path
$upload_url = explode("/",$_SERVER["REQUEST_URI"]);
array_pop($upload_url);
$upload_url = implode("/",$upload_url)."/";

// virtual column to display uploaded file in grid
$col = array();
$col["title"] = "Image";
$col["name"] = "TAM_LOGO";
$col["width"] = "200";
$col["editable"] = true;
// display none if nothing is uploaded, otherwise make link.
$col["condition"] = array('$row["TAM_LOGO"] == ""', "None", "<a href='$upload_url/{TAM_LOGO}' target='_blank'><img height=100 src='$upload_url/{TAM_LOGO}'></a>");
$col["show"] = array("list"=>true,"edit"=>true,"add"=>true); // only show in listing & image in edit
// display image in edit dialog
$col["editoptions"]["dataInit"] = "function(o){jQuery(o).parent().html(o.value);}";
$cols[] = $col;

Thanks – Greg

1 Answers
Abu Ghufran answered 3 years ago

It looks like some html formtting is wrong causing partial tag as string.
I cannot tell generate this as it requires exact data and case.

You can try inspecting using firebug.
Inspect > point to "a>" > it would show the incorrect html tags in html view.

If your solution is online, i can also review.

Your Answer

16 + 12 =

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!