Adhikar Patil

Adhikar Patil

  • 1.6k
  • 434
  • 72k

I am having data with images which comes from controller using jqgrid

Oct 7 2020 12:04 PM
Hello,
 
I am having following data with images which comes from mvc controller(i.e. url) and i want to display this data into jqgrid but i want to display four records in one row. So how can i display this data with images?
 
var data = [[1, "Image1", "Admin/Image1.png"], [2, "Image2", "Admin/Image2.png"], [3, "Image3", "Admin/Image3.png"], [4, "Image4", "Admin/Image4.png"], [5, "Image5", "Admin/Image5.png"], [6, "Image6", "Admin/Image6.png"], [7, "Image7", "Admin/Image7.png"]];
Also i have an following jqgrid code
$("#photoGrid").jqGrid({
url: '/PhotoTab/getPhotoList',
postData: { id: key },
datatype: 'json',
colModel: [
{ label: 'Image', name: 'ImageKey', formatter: imageFormatter1, width: 180, height: 200 },
{ label: 'Id', name: 'Id', hidden: true, editable: true },
],
viewrecords: false,
height: 1600,
rowNum: 1000,
sortname: 'Id',
altRows: false,
cols:4,
sortable: true,
loadonce: true,
pgbuttons: false,
pgtext: "",
pginput: false,
gridComplete: function () {
var ids = jQuery("#photoGrid").jqGrid('getDataIDs');
var outerwidth = $('#Photo_tab_5').width();
if (outerwidth > 0) {
$('#photoGrid').setGridWidth(outerwidth);
}
},
inlineData: {
key: function () {
return $("#topdroplist").val();
}
},
editurl: "/photoTab/saveEditGrid",
pager: "#photoGridPager"
});
 
Please suggest me as soon as posssible

Answers (2)