Advertisement
Guest User

Untitled

a guest
Jun 17th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. diff -r c03decd8ded0 static/js/noc/core/ModelApplication.js
  2. --- a/static/js/noc/core/ModelApplication.js Tue Jun 17 16:50:27 2014 +0400
  3. +++ b/static/js/noc/core/ModelApplication.js Tue Jun 17 16:53:01 2014 +0400
  4. @@ -39,11 +39,16 @@
  5. // Variables
  6. me.currentQuery = {};
  7. // Create store
  8. + var bs = Math.ceil(screen.height / 24);
  9. me.store = Ext.create("NOC.core.ModelStore", {
  10. model: me.model,
  11. customFields: me.noc.cust_model_fields || [],
  12. autoLoad: false,
  13. - pageSize: 1 // Increased by AutoSize plugin
  14. + pageSize: bs,
  15. + leadingBufferZone: bs,
  16. + numFromEdge: Math.ceil(bs / 2),
  17. + trailingBufferZone: bs,
  18. + buffered: true
  19. });
  20. me.idField = me.store.idProperty;
  21. me.ITEM_GRID = me.registerItem(me.createGrid());
  22. @@ -214,7 +219,6 @@
  23. handler: me.onFavItem
  24. },
  25. {
  26. - //iconCls: "icon_page_edit",
  27. glyph: NOC.glyph.edit,
  28. color: NOC.colors.edit,
  29. tooltip: "Edit",
  30. @@ -284,14 +288,14 @@
  31. {
  32. xtype: "toolbar",
  33. items: me.applyPermissions(gridToolbar)
  34. - },
  35. + }/*,
  36. {
  37. xtype: "pagingtoolbar",
  38. store: me.store,
  39. dock: "bottom",
  40. displayInfo: true,
  41. plugins: new Ext.ux.ProgressBarPager()
  42. - }
  43. + }*/
  44. ];
  45. //
  46. if(me.treeFilter) {
  47. @@ -330,7 +334,14 @@
  48. autoScroll: true,
  49. stateful: true,
  50. stateId: me.appName + "-grid",
  51. - plugins: [Ext.create("Ext.ux.grid.AutoSize")],
  52. + //plugins: [Ext.create("Ext.ux.grid.AutoSize")],
  53. + plugins: [
  54. + {
  55. + ptype: "bufferedrenderer",
  56. + //trailingBufferZone: 50,
  57. + //leadingBufferZone: 50
  58. + }
  59. + ],
  60. selModel: selModel,
  61. dockedItems: gridToolbars,
  62. rbar: grid_rbar,
  63. @@ -743,6 +754,7 @@
  64. var me = this;
  65. if(me.currentQuery)
  66. me.store.setFilterParams(me.currentQuery);
  67. + me.store.data.clear();
  68. me.store.load();
  69. },
  70. // Search
  71. diff -r c03decd8ded0 static/js/noc/core/ModelStore.js
  72. --- a/static/js/noc/core/ModelStore.js Tue Jun 17 16:50:27 2014 +0400
  73. +++ b/static/js/noc/core/ModelStore.js Tue Jun 17 16:53:01 2014 +0400
  74. @@ -95,7 +95,7 @@
  75. me.currentPage = 1;
  76. },
  77.  
  78. - load: function(config) {
  79. + getOpConfig: function(config) {
  80. var me = this;
  81. config = Ext.Object.merge({
  82. params: Ext.Object.merge({}, me.filterParams)
  83. @@ -108,9 +108,14 @@
  84. NOC.error("Failed to fetch data!");
  85. }
  86. }, config);
  87. - // Continue loading
  88. - me.callParent([config]);
  89. + return config;
  90. },
  91. +
  92. + prefetch: function(config) {
  93. + var me = this;
  94. + me.callParent([me.getOpConfig(config)]);
  95. + },
  96. +
  97. // override sync()
  98. sync: function(config) {
  99. var me = this,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement