PDA

View Full Version : Force redraw Grid



Sadd
19 Nov 2012, 3:40 AM
I'm working on a grid and after I update a record from it the grid refresh and do a wrong height calculate and the last row doesn't display correctly.

I'm wondering if is there a way to force the grid to redraw or how can I achieve this effect when rows height changes and grid fails his own height calculation?

Regards,
Sadd.

Farish
19 Nov 2012, 3:56 AM
try grid.doLayout(); or grid.getView().refresh();

Sadd
19 Nov 2012, 4:52 AM
I've tried with both but I gets an strange behavior both method do nothing when I use it programmatically but if I use it from a javascript console works perfectly, any suggestion?

Farish
19 Nov 2012, 6:17 AM
you might not need both. one of them would work for you I guess. If the doLayout fixes it for you, then you can try to add a listener on the grid's view's refresh event to call doLayout:


grid.getView().on('refresh', function () {
grid.doLayout();
});

Sadd
19 Nov 2012, 7:52 AM
That's exactly what I need.

Thanks.
Regards,
Sadd.-