Dhtmlx Grid Integration with SalesForce....

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’);

Hello.

JSON format for dhtmlxGrid should be the following:
docs.dhtmlx.com/doku.php?id=dhtm … at_details

loading method:
myGrid.load(url,“json”);

Also, the following format is available:
[{“id1”:“value1-1”,“id2”:“value1-2”,“id3”:“value1-3”},{“id1”:“value2-1”,“id2”:“value2-2”,“id3”:“value2-3”}]

loading method:
myGrid.load(url,“js”);

hi fnds…

anybody can share small basic example of using dhtmlx grid in salesforce.com

waiting for ur positive rpy…

Hello…
I have problem in passing url in mygrid.load method… and returning json data string…
I got java script syntax error
below is my Apex page below:

<apex:page id=“pg” tabStyle=“Employee__c” controller=“EmployeeDhtmlxGridController” sidebar=“true” standardStylesheets=“false”>

<apex:stylesheet value="{!URLFOR($Resource.dhtmlxLib,‘codebase/dhtmlxgrid.css’)}"/>
<apex:stylesheet value="{!URLFOR($Resource.dhtmlxLib,‘codebase/skins/dhtmlxgrid_dhx_skyblue.css’)}"/>
<apex:includeScript value="{!URLFOR($Resource.dhtmlxLib,‘codebase/dhtmlxcommon.js’)}"/>
<apex:includeScript value="{!URLFOR($Resource.dhtmlxLib,‘codebase/dhtmlxgrid.js’)}"/>
<apex:includeScript value="{!URLFOR($Resource.dhtmlxLib,‘codebase/dhtmlxgridcell.js’)}"/>

<apex:form id=“frm”>
<apex:actionFunction name=“goDhtml” action="{!getAllEmps}" rerender=“frm” >
</apex:actionFunction>
<apex:pageBlock id=“pb”>
<apex:pageBlockSection columns=“1” title=“Dhtmlx Grid View” id=“grid”>
<apex:commandButton value=“Dhtml_Grid” style=“Right:-290px;position:relative;color:#006B6B;” ReRender=“mygrid_div” onclick=“doInitGrid();” />


</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

below is my Apex Controller class :

public with sharing class EmployeeDhtmlxGridController{
public String JSONString {get;set;}
public EmployeeDhtmlxGridController(){
}

  @RemoteAction
public static String getAllEmps() //Need to define as a remote action as we will be calling this through javascript
{
    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 JSONString ;

}

}
Plz Reply…

Please, provide the generated json

Thanks

Hello this is my Json String :

[{“attributes”:{“type”:“Employee__c”,“url”:"/services/data/v26.0/sobjects/Employee__c/a0190000005NTaFAAW"},“Employee_Name__c”:“pqr”,“Address__c”:“pqr”,“Gender__c”:“F”,“Age__c”:23,“Email__c”:“pqr@gmail.com”,“Language__c”:"[Hindi, Gujrati]",“City__c”:“pqr”,“State__c”:“pqr”,“Country__c”:“pqr”},{“attributes”:{“type”:“Employee__c”,“url”:"/services/data/v26.0/sobjects/Employee__c/a0190000005NjymAAC"},“Employee_Name__c”:“afasdfsdf”,“Address__c”:null,“Gender__c”:null,“Age__c”:null,“Email__c”:null,“Language__c”:"[]",“City__c”:null,“State__c”:null,“Country__c”:null},{“attributes”:{“type”:“Employee__c”,“url”:"/services/data/v26.0/sobjects/Employee__c/a0190000005NkGgAAK"},“Employee_Name__c”:“sdfafsaf”,“Address__c”:null,“Gender__c”:null,“Age__c”:null,“Email__c”:null,“Language__c”:"[]",“City__c”:null,“State__c”:null,“Country__c”:null},{“attributes”:{“type”:“Employee__c”,“url”:"/services/data/v26.0/sobjects/Employee__c/a0190000005NBDlAAO"},“Employee_Name__c”:“Ankur chaudhari",“Address__c”:“Amroli,Chaprabhata”,“Gender__c”:“M”,“Age__c”:24,“Email__c”:"ankur@gmail.com”,“Language__c”:"[Eng, Hindi, Gujrati]",“City__c”:“ahemdabad”,“State__c”:“gujrat”,“Country__c”:“india”},{“attributes”:{“type”:“Employee__c”,“url”:"/services/data/v26.0/sobjects/Employee__c/a0190000005NFemAAG"},“Employee_Name__c”:“Aneri vyas”,“Address__c”:“301,prishram 3 rd floor,goddhod road",“Gender__c”:“F”,“Age__c”:26,“Email__c”:"aneri.vyas@gmail.com”,“Language__c”:"[Eng, Hindi, Gujrati]",“City__c”:“surat”,“State__c”:“gujrat”,“Country__c”:“india”},{“attributes”:{“type”:“Employee__c”,“url”:"/services/data/v26.0/sobjects/Employee__c/a0190000005NHEFAA4"},“Employee_Name__c”:“sachin1”,“Address__c”:“majura gate,takshshila apt",“Gender__c”:“M”,“Age__c”:38,“Email__c”:"sachin@yahoo.com”,“Language__c”:"[Eng, Hindi, Gujrati]",“City__c”:“surat”,“State__c”:“gujrat”,“Country__c”:“india”}]

You may try to load your json with the following code:

mygrid.setColumnIds(“Employee__c,Employee_Name__c,Address__c,…”)

mygrid.load(data,“js”)

NOTE: dhtmlxgrid_json.js should be added to the page. You can find it in “codebase/ext/” directory (available in PRO version only)

NOTE 2:

{"type":"Employee__c","url":"/services/data/v26.0/sobjects/Employee__c/a0190000005NTaFAAW"},

such type of cell’s definition is not supported. The only way in this case to load data to client-side using the AJAX, convert it to the supported format and load it to the grid using parse() method.

Hello,

I need to used dhtmlx Grid with Salesforce. I am able to load data but I am not able to handle data manipulation like update, insert new and delete actions. Can anyone please help me?

Thank You,
Sally

Please, try to use dhtmlxDataProcessor:
docs.dhtmlx.com/doku.php?id=dhtm … cessor:toc

Hello,

I really wish I can use the data processor but I tried and failed. If you can help or give me an example that would be great.

Thank you,
Sally

You can find different examples of dhtmlxGrid+dhtmlxDataprocessor following the next link:
dhtmlx.com/docs/products/dht … processor/

Unfortunately we have no examples of dhtmlxgrid with dataprocessor with SalesForce so we cannot provide them.

Hi Sally

I need to used dhtmlx Grid with Salesforce. But I can’t able to load data in grid.
I think … i have problem with in parsing data…

can you help me… can you share a demo code. then i will move ahead.
Thanks

Unfortunately we have no examples of dhtmlxgrid integrated witgh SalesForce so we cannot provide them.