views:

1503

answers:

3

i dont see anything in the documentation but i am trying to convert over code that is rendered in an html table over to jquery grid but the one missing piece is that many of the columns have images in them or other specialized html that i would like to show in the grid

+1  A: 

This may not be the answer you're after, but DataTables will construct a grid from an HTML table. It features client side paging, sorting, filtering, client side editing and Ajax callback functions that will for server side paging.

With a table as your "source" you can have what ever you want in the columns.

David Robbins
as you say, doesn't solve for jqgrid but this is an excellent plugin and does what i need
ooo
i had to move accepted to the other answer as technically this was the correct answer to the question
ooo
+4  A: 

To show an image in a grid row, this post has a nice summary:

Return the HTML element as your grid column's data. Do not use ' or " for the src, it will not work properly. The field should be like this:

<img src=../images/my_image.jpg>
Justin Ethier
+1, but your link to experts-exchange is unusable for me. Hopefully I'll try a custom formatter wrapping my image name in an IMG tag, and that'll work.
David V.
A: 

If you want to set Image in cell of jqgrid you have to use a hack, and if your datatype is 'client' it would work very fine.

  1. set the image in a variable.
  2. var crossImg = "set you html src of image";
  3. now set the colmodel like this.
  4. {name:'delImage',index:'delImage', align:'center', width:40, editable:false,formatter: 'integer',formatoptions:{defaultValue:crossImg}}

ENJOY!!!!!!!1

Deepak Kaithwas