PDA

View Full Version : Grid showing only 1 row



franzisk
3 Aug 2007, 4:25 AM
I have this Grid beeing rendered in a body of a BasicDialog, the problem is that it's showing only one the second *record* in the DataStore.

What am I doing wrong?
I have lots of other grids working fine.
Anything related to the BasicDialog?

Codes...


dlgProfileHistory.body.dom.innerHTML='<div id="tb-history"></div><div id="grid-history"></div>';
var height = dlgProfileHistory.getEl().getHeight()-55;
Ext.get('grid-history').applyStyles({
border:'1px solid #99bbe8',
overflow:'hidden',
height: height+'px'
});


The grid:

var gridHistory = new Ext.grid.Grid('grid-history',{
ds: dsHistory,
cm: columnModelHistory,
selModel: new Ext.grid.RowSelectionModel({singleSelect:true}),
loadMask: true,
autoSizeColumns: false,
enableColumnMove: true,
enableRowHeightSync: true
});
gridHistory.render();


Json returned in the DataStore:

{"totalCount":"2", "data":[{id:"63838",username:"curisco",history:"Este usuário é tão lindo e gostoso

que não sabemos nem o que fazer com ele.<br>Onde ele vai as bichas fala \'ai que pliso, ai que lindo\', coisa de louco mesmo.<br>Pronto isso é um histórico de 3 linhas.<br>",date_history:"2007-08-02

16:49:17",operator:"FRANCISCO VIEIRA"},{id:"63838",username:"curisco",history:"Este usuário fez anivers

ário no dia <font color=\'#ff0000\' size=\'4\'><b>1o. de agosto</b></font> e ninguém lembrou!!!!<br

>Também esse pessoal só pensa em problema problema problema o tempo todo.<br>",date_history:"2007-08-03

08:10:12",operator:"FRANCISCO VIEIRA"}]}

sj137
3 Aug 2007, 6:19 AM
this is how i do it, in case it helps you:

i add the following to the html page:


<div id="hello-dlg" style="visibility:hidden;position:absolute;top:0px;">
<div class="x-dlg-hd">My title</div>
<div class="x-dlg-bd">
<div id="testTab" class="x-dlg-tab" title="tab title">
<div class="inner-tab">
<div id="grid-panel2" style="width:478px;height:300px;">
<div id="editor-grid2"></div>
</div>
</div>
</div>
</div>
</div>


then in my javascript:


var dialog = new Ext.BasicDialog("hello-dlg", {
autoTabs:true,
width:530,
height:300,
shadow:true,
minWidth:300,
minHeight:250,
proxyDrag: true
});

var ds2 = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: myurl
}),
reader: new Ext.data.XmlReader({
record: 'word'
}, Word)
});

var grid2 = new Ext.grid.EditorGrid('editor-grid2', {
ds: ds2,
cm: cm,
selModel: new Ext.grid.RowSelectionModel(),
enableColLock:false,
trackMouseOver:true,
autoSizeColumns:true,
loadMask: true
});

grid2.render();


var layout2 = Ext.BorderLayout.create({
center: {
margins:{left:3,top:3,right:3,bottom:3},
panels: [new Ext.GridPanel(grid2)]
}
}, 'grid-panel2');




unfortunately i'm using an xml reader, so not sure if that's much use to you...