PDA

View Full Version : [OPEN] [#1370] [4.1.0-beta] Grid - "Lazy loading" - issue with layout.



sveins12
Aug 14, 2016, 8:55 PM
I'm loading data into the store in a delayed function. The grid-layout gets messed up, and only the upper-half part of each row is showing (see picture attached below the code):


@{
var x = Html.X();
}

@(
x.Grid()
.Columns(
x.Column()
.DataIndex("Name")
.Text("Name")
.Flex(1)
)
.Store(x.Store())
.Listeners(l => l.Initialize.Handler= @"

//Using setTimeout to make a delay and simulate that the data comes later in the workflow.

setTimeout(function(){
var data = [];
for(var i=0; i<1000; i++)
data.push({Name:'Name'+i, });
item.getStore().loadData(data);
},200);

// I have tried item.refresh() here, but it doesn't help.
")
)

This is how it looks:
24716

fabricio.murta
Aug 16, 2016, 4:26 AM
Hello!

The grid examples you are posting are not working without either setting a height on the grid or adding the .Fullscreen(true) setting. Probably you are doing something to have these examples working on your side with the code as you are providing.

fabricio.murta
Aug 16, 2016, 5:02 AM
Well, but I could reproduce the issue in the end. We've logged it under #1370 (https://github.com/extnet/Ext.NET/issues/1370) and hope to be able to fix it soon! Thanks for reporting it!

sveins12
Aug 16, 2016, 10:39 AM
Yes, I am loading the examples into a Viewport using a common controller, for the simplicity. I didn't know about the .Fullscreen(true) setting until now. I'll try it.

Daniil
Aug 16, 2016, 6:02 PM
Hello,

I've reported it to Sencha:
https://www.sencha.com/forum/showthread.php?319858

As a workaround I can suggest setting this for the Grid:

.ItemHeight(45)
or running this code after loading the data:

grid.setItemHeight(45);
grid.Grid1.refresh();

Daniil
Aug 17, 2016, 7:31 PM
Sencha opened a bug.
https://www.sencha.com/forum/showthread.php?319858