0

Hi friends i am working on JQ-GRID. I want to show Image in specific column, But i don't know how to attach image in JQ-GRID. Can anybody help me or please send me some links, thanks

mario
  • 144,265
  • 20
  • 237
  • 291
  • Possible duplicate http://stackoverflow.com/questions/2288021/image-column-in-jqgrid –  Dec 19 '11 at 08:19
  • By the way on [the page](http://www.trirand.com/jqgridwiki/) which you reference you can read that the name of the product is jqGrid and not JQ-GRID. About your question: you should specify more clear what you want. In which form you want to show the image in the column. Should it be the same image in the column for all rows of the grid? Do you want include it as `` or you want to use background image? What you exactly need. If you need have common image as background you can use [classes](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:colmodel_options) property for the column. – Oleg Dec 19 '11 at 08:33

1 Answers1

0

jqgrid is a feature monster. I tell this everybody who asks about it.

When jqgrid loads, a function is called which actually gets the data you want to display. This is normally an ajax call to your php. As a result set of this function, you can just use xml or json. I prefer json, so I build my result array and do a echo json_encode($myarray)

jQuery("#your_grid_id").jqGrid({ url : '/ajax/getjqgriddata.php'})

Now displaying pictures, there are different ways you can do that. You can either generate a <img src="wherever/mypicture1.png"></img>-link and hand it over in your result, or encode your picture binary data with base64 and deliver it with your result. A more addvanced way is to use an so called formatter and just returning a id for the image.

This depends on you, but I would suggest to get confident with jqgrid, experiment with returning -links to get a feeling how jqgrid works.

There is plenty of good documentation at:

http://trirand.com/blog/jqgrid/jqgrid.html

Just take a look at it.

evildead
  • 4,607
  • 4
  • 25
  • 49