From 8da43f76b77611b5a56cab41b4236dc960894f3e Mon Sep 17 00:00:00 2001 From: Renaud Le Gac <renaud.legac@free.fr> Date: Sun, 27 Mar 2011 17:41:44 +0000 Subject: [PATCH] button export to CSv is working. --- static/plugin_dbui/src/appgridpaging.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/static/plugin_dbui/src/appgridpaging.js b/static/plugin_dbui/src/appgridpaging.js index 2ddfaa49..34ffef6f 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()); -- GitLab