2
Answers

JQXgrid Binding

Sathish Kumar

Sathish Kumar

8y
325
1
Hi All,
         I'm using JQXgrid in my web application. i wanna bind the Json string which is returned from the web method. The web method is hits successfully and returns the json but, in jqxgrid  doesn;t bind the data. 
 
My code is looks below....
 
 
var url = "UserOperation.asmx/GetAllCompanies";
var dataAdapter = null;
$.ajax({
   type: "POST",
   url: url,
   contentType: "application/json; charset=utf-8",
   dataType: "json"
   success: function (data) {   
           alert(data.d);       
           $("#jqxgrid").jqxGrid({      
              width: 700,         
              source: data.d,
              columnsresize: true,
              rowsheight: 30,
              columns: [ 
                    { text: 'Company Name', dataField: 'CompanyName', width: 200 },
                    { text: 'Country', dataField: 'Country', width: 150 }, 
                    { text: 'Contact No.', dataField: 'ContactNo', width: 100 },
                    { text: 'Contact MailID', dataField: 'MailID', width: 100 },
                    { text: 'ActiveState', dataField: 'Status', width: 100 }, 
                    { text: 'Edit', width: 75, align: 'center', width: 50 }
                     ] 
               }); 
            } 
        });  
 
Thanks in advance 
 

Answers (2)