Cliff
28 Oct 2010, 9:53 AM
// Portion of Ext.onReady() ---->>>>
var storeMorphProfile = new Ext.data.JsonStore({
id: 'storeLexAnalMorphID',
autoLoad: false,
fields: ['person', 'first', 'second', 'third']
});
var pgTBar = new Ext.PagingToolbar({
id: 'pgTBarLexAnalMorphID',
pageSize: 4,
store: storeMorphProfile
});
var colLexAnalMorph = new Ext.grid.ColumnModel({
defaults: {
align:'left',
editable: false,
menuDisabled: true,
resizable: true,
sortable: false
},
columns: [
{dataIndex:'person', id:'person', header:"Person"},
{dataIndex:'first', id:'first', header:"1st"},
{dataIndex:'second', id:'second', header:"2nd"},
{dataIndex:'third', id:'third', header:"3rd"}
]
});
var gridLexAnalMorph = new Ext.grid.GridPanel({
id: 'gridLexAnalMorphID',
autoHeight: true,
autoWidth: true,
autoScroll: false,
bbar: pgTBar,
border: false,
colModel: colLexAnalMorph,
columnLines: true,
enableColumnMove: false,
enableColumnResize: true,
layout: 'fit',
store: storeMorphProfile,
stripeRows: true,
viewConfig: {
scrollOffset:0,
forceFit:true
}
});
This is a simple paging requirement, but I can't figure out how to use the PagingToolbar to implement it. The catch is that all the data is contained locally. I keep this local data in an array of POJSOs which I build dynamically. Each array element will render in one grid row. The full array will contain 4-24 elements, so there's not much data. The data will always be displayed in blocks of 4 rows. These objects display just fine when I pass the array to store.load(), but they ALL display. We want 4 at a time, not all.
The PagingToolbar renders properly as configured above. However, an attempt to click the Next button results in the following JS error in FireBug: "this.proxy is undefined".
I want to call my own handler and not some URL or proxy. My handler will need only to know the start param. A filter on the store, passing a subset of array elements to the store.load() call, etc. That won't be the hard part.
How do I redirect the Ext handlers on the paging buttons? If I were to use Ext.override(pgTBar, {myFN() here}), which function(s) should I override? Do I implement a specific event listener for this? What is this PagingMemoryProxy that I see referenced by my Google searches? Is there a best way to handle this? Any suggestions?
var storeMorphProfile = new Ext.data.JsonStore({
id: 'storeLexAnalMorphID',
autoLoad: false,
fields: ['person', 'first', 'second', 'third']
});
var pgTBar = new Ext.PagingToolbar({
id: 'pgTBarLexAnalMorphID',
pageSize: 4,
store: storeMorphProfile
});
var colLexAnalMorph = new Ext.grid.ColumnModel({
defaults: {
align:'left',
editable: false,
menuDisabled: true,
resizable: true,
sortable: false
},
columns: [
{dataIndex:'person', id:'person', header:"Person"},
{dataIndex:'first', id:'first', header:"1st"},
{dataIndex:'second', id:'second', header:"2nd"},
{dataIndex:'third', id:'third', header:"3rd"}
]
});
var gridLexAnalMorph = new Ext.grid.GridPanel({
id: 'gridLexAnalMorphID',
autoHeight: true,
autoWidth: true,
autoScroll: false,
bbar: pgTBar,
border: false,
colModel: colLexAnalMorph,
columnLines: true,
enableColumnMove: false,
enableColumnResize: true,
layout: 'fit',
store: storeMorphProfile,
stripeRows: true,
viewConfig: {
scrollOffset:0,
forceFit:true
}
});
This is a simple paging requirement, but I can't figure out how to use the PagingToolbar to implement it. The catch is that all the data is contained locally. I keep this local data in an array of POJSOs which I build dynamically. Each array element will render in one grid row. The full array will contain 4-24 elements, so there's not much data. The data will always be displayed in blocks of 4 rows. These objects display just fine when I pass the array to store.load(), but they ALL display. We want 4 at a time, not all.
The PagingToolbar renders properly as configured above. However, an attempt to click the Next button results in the following JS error in FireBug: "this.proxy is undefined".
I want to call my own handler and not some URL or proxy. My handler will need only to know the start param. A filter on the store, passing a subset of array elements to the store.load() call, etc. That won't be the hard part.
How do I redirect the Ext handlers on the paging buttons? If I were to use Ext.override(pgTBar, {myFN() here}), which function(s) should I override? Do I implement a specific event listener for this? What is this PagingMemoryProxy that I see referenced by my Google searches? Is there a best way to handle this? Any suggestions?