|
|
@@ -212,6 +212,28 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
|
|
|
me.callParent(arguments);
|
|
|
},
|
|
|
listeners: {
|
|
|
+ boxready: function(grid, width, height, eOpts) {
|
|
|
+ var store = grid.getStore(),
|
|
|
+ dockedItems = grid.getDockedItems(),
|
|
|
+ toolbar = dockedItems[0],
|
|
|
+ header = dockedItems[1],
|
|
|
+ pagingtoolbar = dockedItems[2];
|
|
|
+
|
|
|
+ var gridEl = grid.el.dom,
|
|
|
+ gridHeight = gridEl.getBoundingClientRect().height,
|
|
|
+ toolbarEl = toolbar.el.dom,
|
|
|
+ toolbarHeight = toolbarEl.getBoundingClientRect().height,
|
|
|
+ headerEl = header.el.dom,
|
|
|
+ headerHeight = headerEl.getBoundingClientRect().height,
|
|
|
+ pagingtoolbarEl = pagingtoolbar.el.dom,
|
|
|
+ pagingtoolbarHeight = pagingtoolbarEl.getBoundingClientRect().height;
|
|
|
+
|
|
|
+ var gridBodyHeight = gridHeight - toolbarHeight - headerHeight - pagingtoolbarHeight;
|
|
|
+
|
|
|
+ var pageSize = Math.floor(gridBodyHeight / 32);
|
|
|
+
|
|
|
+ store.setPageSize(pageSize);
|
|
|
+ },
|
|
|
itemClick: function(tableView, record, item, index, e, eOpts) {
|
|
|
if(e.target.parentElement.classList.contains('x-querygrid-code-column')) {
|
|
|
var grid = tableView.up('grid'),
|