row not editable if image is present

Questionsrow not editable if image is present
Metacowboy asked 7 years ago

Some Edit function brakes if a image is present in the row
As soon formater = image turns in Row will return a jquery error if you try to save it and no change to fields.
Just saw same error is in the Demo with the google logo image .
The error also repeats if Field use formater checkbox

anyway would be nice to find a fix love the tables look and feel

thank you for the great work

4 Answers
Abu Ghufran answered 7 years ago

Hello,

Can you update the url and actual steps to regenerate this issue.
I am unable to reproduce it.

Thanks

metacowboy answered 7 years ago

Had the error in your demo center appearance Image demo yesterday but not anymore ,.Still on my local Mamp install.

Chrome /Firefox Browser
jqgrid v 4.3.1 ui-black
return error in consol Firbug
SyntaxError: missing ) after argument list

jQuery('#list1').editRow('<img width='50' height='50' src='http://a0.twimg.com/p&#8230;

Cell format with different hacks suggested by user

$col = array();
$col["title"] = "Image"; // caption of column
$col["name"] = "profileimage"; // grid column name, must be exactly same as returned column-name from sql (tablefield or field-alias)
$col["width"] = "10";
//$col["link"] = "{profileimage}";
//$col["linkoptions"] = "target='_self'";
//METAERROR in Editor mode only
$col["formatter"] = "image"; // format as image —
//$col["default"] = "<img height='50' width='50' src={profileimage}>";
$col["formatoptions"] = array("width"=>50,"height"=>50);
//$col["formatoptions"] = "<img height='50' width='50' src={profileimage}>";
$col["search"] = false;
$col["align"] = "center";
$col["editable"] = false;
//$col["editrules"] = array("url"=>true);
//$col["editoptions"] = array("src"=>'{profileimage}');
$cols[] = $col;

Dont get it to work properly only if formater is commented out it works,same happen with the formater option checkbox . Rendered html looks fine

Abu Ghufran answered 6 years ago

Hello,

I'd recommend to use 'default' param instead of image formatter.
$col["default"] can contain any html code you wish to show in grid cell.

Apologies for late reply.

Abu Ghufran answered 6 years ago

And one more thing, the image cell is non-editable.
You can have another column to change that image data.

Refer File uploading example for more help.
demos/editing/file-upload.php

Regards,

Your Answer

7 + 18 =

Login with your Social Id:

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:

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

Let us improve this post!