Ext JS how to tell PagingToolbar to use parent Grid storage?

Posted by Nazariy on Stack Overflow See other posts from Stack Overflow or by Nazariy
Published on 2009-11-24T14:10:59Z Indexed on 2010/05/13 13:54 UTC
Read the original article Hit count: 645

Filed under:
|

I'm trying to build application that use single config passed by server as non native JSON (can contain functions). Everything works fine so far but I'm curious why PagingToolbar does not have an option to use parent Grid store?

I have tried to set store in my config like this, but without success:

{...
   store:Ext.StoreMgr.lookup('unique_store_id')
}

Is there any way to do so without writing tons of javascript for each view defining store, grid and other items in my application or at least extend functionality of PaginationToolbar that use options from parent object?

UPDATED, Here is short example of server response (minified)

{
"xtype":"viewport",
"layout":"border",
"renderTo":Ext.getBody(),
"autoShow":true,
"id":"mainFrame",
"defaults":{"split":true,"useSplitTips":true},
"items":[
	{"region":"center",
	"xtype":"panel",
	"layout":"fit",
	"id":"content-area",
	"items":{
		"id":"manager-panel",
		"region":"center",
		"xtype":"tabpanel",
		"activeItem":0,
		"items":[
			{
				"xtype":"grid",
				"id":"domain-grid",
				"title":"Manage Domains",
				"store":{
					"xtype":"arraystore",
					"id":"domain-store",
					"fields":[...],
					"autoLoad":{"params":{"controller":"domain","view":"store"}},
					"url":"index.php"
				},
				"tbar":[...],
				"bbar":{
					"xtype":"paging",
					"id":"domain-paging-toolbar",
					"store":Ext.StoreMgr.lookup('domain-store')
				},
				"columns":[...],
				"selModel":new Ext.grid.RowSelectionModel({singleSelect:true}),
				"stripeRows":true,
				"height":350,
				"loadMask":true,
				"listeners":{
					"cellclick":activateDisabledButtons
				}
			}
		]
	},
}
]
}

© Stack Overflow or respective owner

Related posts about extjs

Related posts about gridview