PDA

View Full Version : Grid BufferView



dimitris
21 May 2012, 6:00 AM
Hi,

In Ext 3.0 I used to manage mass amount of records using an EditorGrid with BufferView.js extension,
by writing only a few lines of code (see bellow)

How can I have the same functionality in ext 4.x?



var GridView = new Ext.ux.grid.BufferView({
rowHeight: 20,
scrollDelay: true
});





inGrid = new Ext.grid.EditorGridPanel(
{
title:'Translations',
renderTo: renderTo,
deferRowRender:false,
store: inDataStore,
stripeRows: true,
border: true,
enableColumnMove :false,
columnLines : false,
loadMask:true ,
clicksToEdit:1,
cm: defColModel,
tbar: GridToolBar,
sm: inSelModel,
view:GridView,
frame:true,
autoResize:true
});



In Ext4.0 there is a infinite scrolling example but the result is not selectable and NOT editable... and however i did not manage to implement even this.

Thank you very much

scottmartin
21 May 2012, 6:56 AM
You should be able to take this example:
http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/grid/buffer-grid.html

Comment out the line: disableSelection: true,
(allow selection)

Then review the following example:
http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/grid/cell-editing.html

to provide cell editing to your code



var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});

...

plugins: [cellEditing]


It works as expected on this end.

Regards,
Scott.

dimitris
22 May 2012, 12:01 AM
Hi,

I'm using both RowModel and CheckboxModel, but
the selections are lost when I'm scrolling into the grid?

This is a bug or something else happened in my code?

The Store Settings:


var citiesStore = Ext.create('Ext.data.Store', {
model: cities,
id:'citiesStore',
buffered: true,
data: [],
pageSize: 5000,
proxy: {type: 'memory'}
});


The Grid Settings


var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
var selModel = Ext.create('Ext.selection.RowModel', {
mode: 'MULTI',
});

grid = Ext.create('Ext.grid.Panel', {
store: citiesStore,
columns: columns,
plugins: cellEditing,
selModel: selModel,
loadMask: true,
//disableSelection: true,
height: 400,
width: 500,
renderTo: Ext.getBody()
});


Thank you in advance
Dimitris

scottmartin
22 May 2012, 4:41 AM
Please keep in mind that when you are buffering data, your are actually reloading records in the the grid when you reach the buffer limit.

There are several plugins that save check persistence on paging, but I have not tested to see if they working on buffering:

http://www.sencha.com/forum/showthread.php?186866
http://www.sencha.com/forum/showthread.php?163418

They may provide some insight on how to perform this on a buffered grid.

Regards,
Scott.