Hi all,

I have a TreePanel that displays two different kind of data (lets name them "departaments" and "users"). Therefore i created two stores, each one of them includes different models.

my API has two methods: Department::fetchAll() and User::findByDepartmentId(int departmentId) and stores have pre-configured proxy
Code:
Ext.define('APP.store.User', {
	extend: 'Ext.data.TreeStore',
	requires: 'APP.model.User',
	model: 'APP.model.User',
	proxy: {
		type: 'ajax',
		api: {
			read: 'ajax/user/findByDepartmentId'
		},
		reader: {
			type: 'json',
			root: 'result',
			successProperty: 'success'
		}
	}
});

Ext.define('APP.store.Department', {
	extend: 'Ext.data.TreeStore',
	requires: 'APP.model.Department',
	model: 'APP.model.Department',
	proxy: {
		type: 'ajax',
		api: {
			read: 'ajax/department/fetchAll'
		},
		reader: {
			type: 'json',
			root: 'result',
			successProperty: 'success'
		}
	}
});
the structure I want to display looks like:

Code:
Department 1
  | --- User 1
  | --- User 2
Department 2
  | --- User 1
  | --- User 2
I created a department store and assigned it to the init config to the tree panel, and it renders departaments properly. Then after render I'm trying to change the store (using reconfigure or bindStore) but it throws me an error:

Code:
views is undefined
I searched the forums and I found this:

http://www.sencha.com/forum/showthread.php?152298-4.0.7-Error-on-bind-Store-if-view-is-not-rendered&highlight=this.views

a
fter applying it to my code it gives me this:

Code:
me.store.indexOf is not a function
anyone's got any ideas? maybe there is some other way to reach this kind of tree...

thank you in advance!