Click here to Skip to main content
15,892,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi, i have a issue related to jgrid ...
hi i am using webservice and all the web service and all the jgrid are working good and my value also comes to browser (firebug)... but after this i can't show in grid to my page...
i have a table with 4 parameter (Id,Name,EmailId,Location)
$.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
           url: "DesktopModules/Shopism_Anupam/anupamWebService.asmx/GridList",
            data: "{}",
            dataType: "json",
            success: function (data) {
                alert("hi");
            },
            error: function (result) {
                alert("Error");
            }
        });

after this i check my value at firebug but i can't do anything after this...
please help....
Posted
Updated 13-Oct-14 5:22am
v2
Comments
Thanks7872 13-Oct-14 6:15am    
And you assume that everything else will be automatic? I don't see any code where you are trying to bind data to JQGrid.

e.g. http://www.codecomplete4u.com/fill-jqgrid-json-data/
AnUpAm 786 14-Oct-14 2:34am    
sorry Rohan ..... i did not show whole code but .... i am trying with ..

$("#grid").jqGrid({
datatype: function () {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "DesktopModules/S_Anupam/anupamWebService.asmx/GridList",
data: "{}",
dataType: "json",
success: function (data) {
var thegrid = $("#grid");
for (var i = 0; i < data.d.length; i++)
{
thegrid.addRowData(data.d[i].Id, { "Id": data.d[i].Id, "Name": data.d[i].Name, "EmailId": data.d[i].EmailId, "Location": data.d[i].Location });

}
},
error: function (result) {
alert("Error");
}
});
},
colNames: ['Id', 'Name', 'EmailId', 'Location'],
colModel: [
{ name: 'Id', stype: 'text', index: 'Id', width: 250 },
{ name: 'Name', stype: 'text', index: 'Name', width: 150 },
{ name: 'EmailId', stype: 'text', index: 'EmailId', width: 180 },
{ name: 'Location', stype: 'text', index: 'Location', width: 100 }
],
rowNum: "10",
mytype: 'GET',
loadonce: true,
rowList: [10, 20, 30],
viewrecords: true,
});

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900