Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r c03decd8ded0 static/js/noc/core/ModelApplication.js
- --- a/static/js/noc/core/ModelApplication.js Tue Jun 17 16:50:27 2014 +0400
- +++ b/static/js/noc/core/ModelApplication.js Tue Jun 17 16:53:01 2014 +0400
- @@ -39,11 +39,16 @@
- // Variables
- me.currentQuery = {};
- // Create store
- + var bs = Math.ceil(screen.height / 24);
- me.store = Ext.create("NOC.core.ModelStore", {
- model: me.model,
- customFields: me.noc.cust_model_fields || [],
- autoLoad: false,
- - pageSize: 1 // Increased by AutoSize plugin
- + pageSize: bs,
- + leadingBufferZone: bs,
- + numFromEdge: Math.ceil(bs / 2),
- + trailingBufferZone: bs,
- + buffered: true
- });
- me.idField = me.store.idProperty;
- me.ITEM_GRID = me.registerItem(me.createGrid());
- @@ -214,7 +219,6 @@
- handler: me.onFavItem
- },
- {
- - //iconCls: "icon_page_edit",
- glyph: NOC.glyph.edit,
- color: NOC.colors.edit,
- tooltip: "Edit",
- @@ -284,14 +288,14 @@
- {
- xtype: "toolbar",
- items: me.applyPermissions(gridToolbar)
- - },
- + }/*,
- {
- xtype: "pagingtoolbar",
- store: me.store,
- dock: "bottom",
- displayInfo: true,
- plugins: new Ext.ux.ProgressBarPager()
- - }
- + }*/
- ];
- //
- if(me.treeFilter) {
- @@ -330,7 +334,14 @@
- autoScroll: true,
- stateful: true,
- stateId: me.appName + "-grid",
- - plugins: [Ext.create("Ext.ux.grid.AutoSize")],
- + //plugins: [Ext.create("Ext.ux.grid.AutoSize")],
- + plugins: [
- + {
- + ptype: "bufferedrenderer",
- + //trailingBufferZone: 50,
- + //leadingBufferZone: 50
- + }
- + ],
- selModel: selModel,
- dockedItems: gridToolbars,
- rbar: grid_rbar,
- @@ -743,6 +754,7 @@
- var me = this;
- if(me.currentQuery)
- me.store.setFilterParams(me.currentQuery);
- + me.store.data.clear();
- me.store.load();
- },
- // Search
- diff -r c03decd8ded0 static/js/noc/core/ModelStore.js
- --- a/static/js/noc/core/ModelStore.js Tue Jun 17 16:50:27 2014 +0400
- +++ b/static/js/noc/core/ModelStore.js Tue Jun 17 16:53:01 2014 +0400
- @@ -95,7 +95,7 @@
- me.currentPage = 1;
- },
- - load: function(config) {
- + getOpConfig: function(config) {
- var me = this;
- config = Ext.Object.merge({
- params: Ext.Object.merge({}, me.filterParams)
- @@ -108,9 +108,14 @@
- NOC.error("Failed to fetch data!");
- }
- }, config);
- - // Continue loading
- - me.callParent([config]);
- + return config;
- },
- +
- + prefetch: function(config) {
- + var me = this;
- + me.callParent([me.getOpConfig(config)]);
- + },
- +
- // override sync()
- sync: function(config) {
- var me = this,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement