-
22 Nov 2012 6:20 AM #31
Hi,
Your code for sorting works fine, thanks.
And for that column header thing, I am sending parameter to PHP like,
So this id will form a query like,Code:http://localhost/test/php/data.php?param1=id
and forms grid.Code:SELECT id from table_name
When I pass parameter (this will be done with a button click event) first time and forms grid and works fine, but when I am not sending parameter again (second click) like,
It has the previously added column in the grid with no data like I shown in the picture.Code:http://localhost/test/php/data.php?param1=
I think what you mentioned there as JSON response is right, since there is no id in second click, JSON is empty and not showing data, but can we have like when there is not parameter sent, grid shouldn't form?
-
23 Nov 2012 12:17 AM #32
I did it myself in the controller,
Hiding the entire grid when not necessary. And thanks for your plugin, this helped me in a great way.Code:Ext.get('grid_id').hide();
-
23 Nov 2012 12:53 AM #33
I created for you more complex soluction that is more elastic I think.
Look into github last commit:
https://github.com/nonameplum/Dynami...42bea62c775c02
But hiding grid is good too.
I was thought that this will require changes in dynamicGrid or dynamicReader class but not, it could be easly done in e.g. controller.
I'm glad I could help.
Best regards.
-
23 Nov 2012 1:13 AM #34
Hi,
That worked good, thanks, you need to add,
also to remove data also from the grid, thanks for your help.Code:dynamicGrid.getStore().removeAll();
Can we integrate,
https://market.sencha.com/users/68/extensions/95
this too in your plugin?
-
23 Nov 2012 1:25 AM #35
-
23 Nov 2012 1:36 AM #36
If you don't mind can you tell me where I have to add Filter plugin? Because your plugin creates dataIndex and columns dynamically, but that plugin needs it to be given it in the static grid
.
-
23 Nov 2012 2:12 AM #37
You have to look to filter plugin code, how it works (I have never used this plugin), but probably you have to create plugin dynamically in reconfigure dynamicGrid's event -> http://docs.sencha.com/ext-js/4-1/#!...nt-reconfigure
-
27 Nov 2012 2:44 AM #38
I would also love to see this work in SA2!
Anyone had any success yet?

-
28 Nov 2012 5:24 AM #39
Hi iamiebie,
Still couldn't find a way to use plugins in SA, if someone knows how, please enlighten us, that would be of great help.
I would love to have pagingtoolbar in this plugin, tried like in,
http://docs.sencha.com/ext-js/4-1/#!...toolbar.Paging
But not getting it right, please help!
-
28 Nov 2012 8:28 AM #40
I did the following changes in DynamicGrid to get pagingtoolbar,
Initially it shows 1 of 2 pages and all, but it forms grid with all data in all page.Code:Ext.define('Ext.ux.grid.DynamicGrid', { extend: 'Ext.grid.Panel', alias: 'widget.dynamicGrid', alternateClassName: 'Ext.grid.DynamicGrid', requires: [ 'Ext.ux.data.reader.DynamicReader' ], // URL used for request to the server. Required url: '', initComponent: function() { console.log('DynamicGrid initComponent!'); var me = this; if (me.url == '') { Ext.Error.raise('url parameter is empty! You have to set proper url to get data form server.'); } else { var DynamicGrid = Ext.applyIf(me, { columns: [], forceFit: false, store: Ext.create('Ext.data.Store', { // Fields have to be set as empty array. Without this Ext will not create dynamic model. fields: [], // After loading data grid have to reconfigure columns with dynamic created columns // in Ext.ux.data.reader.DynamicReader listeners: { 'metachange': function(store, meta) { me.reconfigure(store, meta.columns); } }, autoLoad: true, pageSize: 10, remoteSort: false, remoteFilter: false, remoteGroup: false, proxy: { reader: 'dynamicReader', type: 'rest', url: me.url } }) }); } me.bbar = Ext.create('Ext.PagingToolbar', { store: me.store, displayInfo: true, displayMsg: 'Displaying topics {0} - {1} of {2}', emptyMsg: "No topics to display" }); me.callParent(arguments); } });
Where should I set totalProperty?Last edited by sencha.user; 29 Nov 2012 at 5:52 AM. Reason: Wrong info given, so changed now


Reply With Quote