Привет. Используя приведенный ниже код, я могу загрузить данные XML в DHTMLXGrid, и он работает нормально. Но когда я пытаюсь загрузить те же данные в формате Json, они не работают. Я прошу вас, чтобы кто-нибудь помог мне в этом. Я пробовал все в этом коде, используя json, но :( :(. Ваша помощь очень ценится, мне нужен рабочий пример.
<script type="text/javascript">
dhtmlx.image_path = "codebase/imgs/";
dhtmlxEvent(window,"load",function(){
var layout = new dhtmlXLayoutObject(document.body,"2U");
layout.cells("a").setText("Contacts");
layout.cells("b").setText("Contact Details");
layout.cells("b").setWidth(500);
var menu = layout.attachMenu();
menu.setIconsPath("icons/");
menu.loadStruct("data/menu.xml");
var toolbar = layout.attachToolbar();
toolbar.setIconsPath("icons/");
toolbar.loadStruct("data/toolbar.xml");
var contactsGrid = layout.cells("a").attachGrid();
contactsGrid.setHeader("Name,Last Name,Email"); //sets the headers of columns
contactsGrid.setColumnIds("fname,lname,email"); //sets the columns' ids
contactsGrid.setInitWidths("250,250,*"); //sets the initial widths of columns
contactsGrid.setColAlign("left,left,left"); //sets the alignment of columns
contactsGrid.setColTypes("ro,ro,ro"); //sets the types of columns
contactsGrid.setColSorting("str,str,str"); //sets the sorting types of columns
contactsGrid.init();
contactsGrid.loadXML("data/data.xml",true,true);
});
</script>