Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Alex Schäfer on Jun 20, 2008 05:40
open dhtmlx forum
Can't edit cells after loading data with Json

Hi all,

have a grid and fill it with data from Json. That works great also the sorting, but I can't select any row or edit any cell. what do I wrong???

    function doInitGrid(){
            
            mygrid = new dhtmlXGridObject('mygrid_container');
            mygrid.setImagePath("includes/codebase/imgs/");
            mygrid.setHeader("Seitenname,CSS Pfad, Erstellt, Geändert");
            mygrid.setColTypes("txt,txt,ro,ro");
            mygrid.setInitWidths("*,*,180,180");         
            mygrid.setColAlign("left,left,center,center");             
            mygrid.setColSorting("str,str,date,date");
mygrid.enableMultiline(true)
            mygrid.setSkin("light");
            mygrid.init();
            mygrid.load("includes/dataconnector/getSites.php","json");
        }
Answer posted by Support on Jun 20, 2008 07:18
Most probably problem caused by missed rows ID in json data, please be sure that each row has unique ID

    mygrid.parse({
        rows:[
        {id:1, data:["1","2","3","4"]},
        {id:2, data:["5","6","7","8"]}
        ]
        },"json");
Answer posted by Alex Schaefer on Jun 20, 2008 08:22
Ok thank you. That was it! Now it works.

Thank you very much!!!!