I'm building my first platform using Ext.js, and I'm trying to figure it out how can I specify a limit of rows for my Gridpanel. I would like to show only the last 10 values from a store
At the moment, I'm receiving all the values from a store, and I'm populating the grid with this values,
I could use this:
gridStore.remove(gridStore.getAt(i))
But I can't remove the data from the store because I'm using this store to load some polylines on a map too, so I have to hide the rows instead of removing data from the store.
My Store:
Ext.define('ES.store.Timeline', {
extend: 'Ext.data.Store',
alias: 'store.timeline',
storeId: 'timeline',
fields: [
'vid', 'time', 'lat', 'lng', 'address', 'dir', 'vel', 'hidden'
],
pageSize: 500,
autoSync:true,
sorters: [
{
property: 'time',
direction: 'DESC'
}
],
data: {
query: []},
proxy: {
type: 'sessionstorage',
id: 'sessionTimeline',
reader: {
type: 'json',
rootProperty: 'query'
}
},
filters: [{ property: 'hidden', value: false }]
});
My Grid
Ext.define('ES.view.Layout.Menu.Menu', {
extend: 'Ext.grid.Panel',
alias: 'widget.timelineBar',
controller: 'menu',
viewModel: 'menu',
pageSiz: '10',
id: 'timelineBar',
autoScroll: true,
title: 'Timeline',
store: {
type: 'timeline'
},
columns: {
border: false,
defaults: {
hoverCls: ''
},
items: [{ ...
}]
}
});
Thank you