not interpret html code in a cell.

Questionsnot interpret html code in a cell.
Sebastián Esteller asked 10 years ago

Hello,
Is possible not interpret html code in a cell. In my database i have a field with html code and when content is loaded in grid, this interpret html code and resize heigth of row and not is aesthetic.

Thanks!

3 Answers
Abu Ghufran answered 10 years ago

Hello,

You can use custom formatter for column. For e.g.

$col["formatter"] = "function(cellval,options,rowdata){ return jQuery.jgrid.htmlDecode(cellval); }";
$col["unformat"] = "function(cellval,options,rowdata){ return jQuery.jgrid.htmlEncode(cellval); }";

formatter function will be called on display, and unformat on editing display mode.

Ananda Theerthan answered 8 years ago

Hi,
I am using
$col["formatter"] = "function(cellval,options,rowdata){ return jQuery.jgrid.htmlDecode(cellval); }";

to format HTML data stored in database. But when I edit the cell, the HTML tags are getting displayed.Anyway to show only the formatted output during edit also.

Abu Ghufran answered 8 years ago

You also need to add unformat line.

$col["unformat"] = "function(cellval,options,rowdata){ return jQuery.jgrid.htmlEncode(cellval); }";

Your Answer

1 + 8 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?