How can I bind the ajax result to jqxGrid? I got confused on how to do it the right way because in the jqxGrid samples their source is just a text file. Anyone could give me idea to do it the right way will be a big help
as of now here is my ajax code returning a result
$.ajax({
type: 'post',
url: 'ws.asmx/GetStudentsById',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: JSON.stringify({
studID: id
}),
success: function (data) {
var toAppend ='<table>';
$.each(data, function (key, val) {
for (var i = 0; i < val.length; i++) {
toAppend+='<tr>';
toAppend+='<td>'+val[i]['StudID']+'</td>';
toAppend+='<td>'+val[i]['StudName']+'</td>';
toAppend+='</tr>';
}
toAppend += '</tbody></table>';
});
$('#results').append(toAppend);
}
});
under the success i want to change it to jqxGrid and i dont know how should i start it. thanks
You need to change the dataType to xml
as you're using legacy asmx service which gets the content as XML by default, not json.