jqGrid Carregamento automático do Treegrid. .
Estou tendo um problema com uma grade de árvore de carregamento automático. No momento, tenho uma estrutura com apenas 2 níveis de profundidad
1
a
b
c
2
a
Quando clico para expandir um nó, a grade parece adicionar outra instância do nó raiz novamente, bem como o (s) subnó (s) que deve (m) ser mostrado (s) com base no nó raiz selecionad
1
1
a
b
c
Aqui está uma olhada no XML antes de selecionar o nó raiz:
<?xml version="1.0" encoding="UTF-8"?>
<rows>
<page>1</page>
<total>1</total>
<records>1</records>
<row>
<cell>1112</cell>
<cell>Parent 1</cell>
<cell>0</cell>
<cell>NULL</cell>
<cell>false</cell>
<cell>false</cell>
</row>
</rows>
E aqui está uma olhada no XML depois de selecionar o nó raiz:
<?xml version="1.0" encoding="UTF-8"?>
<rows>
<page>1</page>
<total>1</total>
<records>1</records>
<row>
<cell>1112</cell>
<cell>Parent 1</cell>
<cell>0</cell>
<cell>NULL</cell>
<cell>false</cell>
<cell>false</cell>
</row>
<row>
<cell>5207</cell>
<cell>Child 1</cell>
<cell>1</cell>
<cell>1112</cell>
<cell>false</cell>
<cell>false</cell>
</row>
</rows>
Além disso, aqui está a minha configuração:
$(document).ready(function(){
$("#gReport").jqGrid({
treeGrid: true,
treeGridModel: 'adjacency',
ExpandColumn: 'company',
url: document.forms['frmReport'].elements['gaddr'].value,
datatype: 'xml',
mtype: 'GET',
colNames: ["ID", "Company"],
colModel: [
{name: 'id', index: 'id', width: 1, hidden: true, key: true},
{name: 'company', index: 'company', width: 40, hidden: false, sortable: true}
],
rowNum: -1,
width: 980,
height: 'auto',
pager: false,
caption: ''
}),
});
Qualquer ajuda seria muito apreciada. Obrigado. -chris