diff --git a/static/plugin_dbui/src/appgridpaging.js b/static/plugin_dbui/src/appgridpaging.js index 2ddfaa49035ec0eaf1066d5e19b2a9e6a3fcc91a..34ffef6f74fb371fadf16586e7bf7749e7560c6a 100644 --- a/static/plugin_dbui/src/appgridpaging.js +++ b/static/plugin_dbui/src/appgridpaging.js @@ -44,9 +44,9 @@ App.grid.Paging = Ext.extend(Object, { }, '->', { - xtype: 'button', + xtype: 'xbuttondownload', text: 'Export to CSV', - listeners: {click: this.onExport} + url: App.csvUrl + '?tableName=' + App.getTableName(grid.store) } ); @@ -80,13 +80,6 @@ App.grid.Paging = Ext.extend(Object, { bbar.moveFirst(); }, - /** - * Handler to export the grid content as a CSV file - */ - onExport: function (button, event) { - Ext.Msg.alert('Warning', 'Functionality not yet implemented'); - }, - /** * Handler to initialize the number of rows per page and the number of page * the scope is the grid @@ -97,11 +90,7 @@ App.grid.Paging = Ext.extend(Object, { grid = this, nRows = store.getCount(), slider; - - if (grid.pagingInitialized) { - return; - } - + bbar = grid.getBottomToolbar(); bbar.pageSize = nRows; @@ -123,7 +112,7 @@ App.grid.Paging = Ext.extend(Object, { slider; bbar = grid.getBottomToolbar(); - + slider = bbar.findByType('slider')[0]; slider.setMaxValue(grid.store.getTotalCount()); slider.setValue(grid.store.getCount());