Hello fnd…
I got the problem in parsing list to json in apex class…
when i m integrating DHtmlx3.5 grid with Salesforce Apps…
Salesforce with Dhtmlx3.5 It is possible…?
Apex class is below
// Apex class :
public with sharing class EmployeeDhtmlxGridController{
public String JSONString {get;set;}
public EmployeeDhtmlxGridController(){
}
public pagereference getAllEmps(){
List<Employee__c> accounts = [select Employee_Name__c,Address__c,Gender__c,Age__c,Email__c,Language__c,City__c,State__c,Country__c from Employee__c ORDER By Name ];
String JSONString = JSON.serialize(accounts);//This is how we can serailize our response into JSON format
return '{\"Records\":' +JSONString+', \"error\": \"null\", \"status\":\"SUCCESS\", \"count\":\"' + accounts.size() + '\" }';
}
}
/==============================================================
Call mygrid.load:
mygrid.load(EmployeeDhtmlxGridController.getAllEmps(),’’,‘json’);