Pagination is not updating the view when the next button is clicked - extjs

The total number of rows is correctly showing in pagination but Pagination is not updating the view when the next button is clicked.
I'm new to Sencha. In Mysql, I'm returning all rows. So that I can limit in client side. If I limit the rows in backend, I cannot have all the rows in client side.
View: List.js
/*** This view is an example list of people.
*/
Ext.define('CRUD.view.main.List', {
extend: 'Ext.grid.Panel',
xtype: 'home',
requires: [
'CRUD.store.Personnel'
],
title: 'Heroes',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
layout: 'fit',
fullscreen: true,
store: {
type: 'personnel',
},
columns: [
{ text: 'Name', dataIndex: 'name', sortable: true, flex: 1 },
{ text: 'Email', dataIndex: 'email', sortable: true, flex: 1 },
{ text: 'Phone', dataIndex: 'phone', sortable: true, flex: 1 }
],
bbar: {
store: {
type: 'personnel',
},
xtype: 'pagingtoolbar',
displayInfo: true
},
// columns: [
// { text: 'Name', dataIndex: 'name', flex: 1 },
// { text: 'Email', dataIndex: 'email', flex: 1 },
// { text: 'Phone', dataIndex: 'phone', flex: 1 }
// ],
listeners: {
select: 'onItemSelected',
},
});
Store: Personnel.js
Ext.define('CRUD.store.Personnel', {
extend: 'Ext.data.Store',
alias: 'store.personnel',
model: 'CRUD.model.User',
id: 'list',
fields: [
'name', 'email', 'phone'
],
// data: [
// { name: 'Jean Luc', email: "jeanluc.picard#enterprise.com", phone: "555-111-1111" },
// { name: 'Worf', email: "worf.moghsson#enterprise.com", phone: "555-222-2222" },
// { name: 'Deanna', email: "deanna.troi#enterprise.com", phone: "555-333-3333" },
// { name: 'Data', email: "mr.data#enterprise.com", phone: "555-444-4444" }
// ],
autoLoad: {
start: 0,
limit: itemsPerPage
},
buffered: true,
pageSize: itemsPerPage,
remoteSort: true,
proxy: {
type: 'jsonp', //cross domain calls - json parser
url: 'http://localhost:8080/list',
enablePaging: true,
reader: {
type: 'json',
totalProperty: 'total'
},
},
// proxy: {
// type: 'memory',
// reader: {
// type: 'json',
// }
// },
});

bbar: {
store: {
type: 'personnel',
},
xtype: 'pagingtoolbar',
displayInfo: true
},
I have removed store inside bbar and it works. Thanks for being cooperative.

The way you're using the store, ExtJS will do a request every time you change the page, sending the page number parameter to the URL set to the store.
If you want to do client-side pagination using ExtJS, you must set your store's proxy type to memory, load your data into the store and then ExtJS Grid will handle pagination as you expect.
Do an Ext.Ajax.Request like that:
Ext.Ajax.request({
url: 'http://localhost:8080/list',
success: function(response) {
dataStore.setProxy({
type: "memory",
enablePaging: true,
data: Ext.JSON.decode(response.responseText) //here you need to adapt to your response structure
});
dataStore.load();
}
});

For cross domain, you can make a call to Ext.data.JsonP.request() method and process the response as shown in the code below:
Ext.data.JsonP.request({
url: 'data1.json',
success: function (response) {
var myData = [];
Ext.Array.forEach(response.data, function (item) {
myData.push({
name: item.name,
email: item.email,
phone: item.phone
});
});
store.setProxy({
type: "memory",
enablePaging: true,
data: myData
});
store.load();
}
});
Check this fiddle for complete working example.

Related

Deleting the row is not updating the grid? Sencha Extjs Application

When I delete any current row, the next row and pagination has to get updated in the empty row. But it is not updating the pagination but the url is passing in network correctly. When I refresh the page, the empty row is replaced by the next row.
List.js:
/**
* This view is an example list of people.
*/
Ext.define('CRUD.view.main.List', {
extend: 'Ext.grid.Panel',
xtype: 'home',
requires: [
'CRUD.store.Personnel',
'CRUD.view.main.MainController',
'Ext.toolbar.Paging',
],
title: 'Heroes',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})
],
layout: 'fit',
fullscreen: true,
store: {
type: 'personnel',
},
selModel: {
pruneRemoved: false
},
selType: 'cellmodel',
columns: [{
text: 'Name',
align: 'center',
dataIndex: 'name',
sortable: true,
flex: 1,
editor: {
xtype: 'textfield',
selectOnFocus: true,
allowBlank: false
}
},
{
text: 'Email',
align: 'center',
dataIndex: 'email',
sortable: true,
flex: 1,
editor: {
xtype: 'textfield',
selectOnFocus: true,
allowBlank: false
}
},
{
text: 'Phone',
align: 'center',
dataIndex: 'phone',
sortable: true,
flex: 1,
editor: {
xtype: 'textfield',
selectOnFocus: true,
allowBlank: false
}
},
{
text: 'Save',
align: 'center',
xtype: 'actioncolumn',
items: [{
icon: 'http://icons.iconarchive.com/icons/oxygen-icons.org/oxygen/128/Actions-document-edit-icon.png',
xtype: 'submit',
handler: function(grid, rowIndex, colIndex, item, e, record) {
Ext.Msg.confirm("Confirmation", "Do you want to Save?", function(btnText) {
if (btnText === "yes") {
Ext.Ajax.request({
url: 'http://localhost:8080/edit?id=' + record.data.id + '&name=' + record.data.name + '&email=' + record.data.email + '&phone=' + record.data.phone,
method: 'POST', //this is the url where the form gets submitted
useDefaultXhrHeader: false,
success: function(response) {
store.load()
},
failure: function(form, action) {
Ext.Msg.alert('Failed', action);
}
});
}
});
}
}],
}, {
text: 'Delete',
xtype: 'actioncolumn',
align: 'center',
items: [{
icon: 'http://www.freeiconspng.com/uploads/delete-button-png-27.png',
xtype: 'submit',
// handler: function(grid, rowIndex, colIndex, item, e, record) {
// console.log(record.data.id)
// // Ext.Msg.confirm('Confirmation', 'Are you sure?', function(btnText) {
// // if (btnText === 'yes') {
// // Ext.Ajax.request({
// // url: 'http://localhost:8080/del/' + record.data.id,
// // method: 'DELETE', //this is the url where the form gets submitted
// // useDefaultXhrHeader: false,
// // cors: true,
// // success: function(form, action) {
// // store.load()
// // },
// // failure: function(form, action) {
// // Ext.Msg.alert('Failed', action);
// // }
// // });
// // }
// // })
// }
}],
listeners: {
click: 'onDeleteClick'
}
}
],
bbar: Ext.create('Ext.PagingToolbar', {
xtype: 'pagingtoolbar',
displayInfo: true,
doRefresh: function() {
this.doLoad(this.cursor);
},
}),
// columns: [
// { text: 'Name', dataIndex: 'name', flex: 1 },
// { text: 'Email', dataIndex: 'email', flex: 1 },
// { text: 'Phone', dataIndex: 'phone', flex: 1 }
// ],
// listeners: {
// select: 'onItemSelected',
// },
});
Store:
Ext.define('CRUD.store.Personnel', {
extend: 'Ext.data.Store',
alias: 'store.personnel',
model: 'CRUD.model.User',
fields: [
'name', 'email', 'phone'
],
// data: [
// { name: 'Jean Luc', email: "jeanluc.picard#enterprise.com", phone: "555-111-1111" },
// { name: 'Worf', email: "worf.moghsson#enterprise.com", phone: "555-222-2222" },
// { name: 'Deanna', email: "deanna.troi#enterprise.com", phone: "555-333-3333" },
// { name: 'Data', email: "mr.data#enterprise.com", phone: "555-444-4444" }
// ],
autoLoad: { offset: 0, limit: 5 },
pageSize: 5,
proxy: {
type: 'ajax', //cross domain calls - json parser
enablePaging: true,
url: 'http://localhost:8080/list',
useDefaultXhrHeader: false,
startParam: 'offset',
limitParam: 'limit',
reader: {
totalProperty: 'total',
rootProperty: 'items'
},
listeners: {
//this is used to construct the proxy url before the load is done
// beforeload: {
// fn: function() {
// var me = this;
// me.updateProxyURL(); //write this function yourself
// }
// }
}
},
// proxy: {
// type: 'memory',
// reader: {
// type: 'json',
// }
// },
});
Controller.js
/**
* This class is the controller for the main view for the application. It is specified as
* the "controller" of the Main view class.
*
* TODO - Replace this content of this view to suite the needs of your application.
*/
Ext.define('CRUD.view.main.MainController', {
extend: 'Ext.app.ViewController',
alias: 'controller.main',
store: {
type: 'personnel',
},
onClick: function(grid) {
Ext.Msg.alert("tesdt")
},
onDeleteClick: function(selModel, record, index, options, grid, store) {
//Ext.Msg.confirm('Confirm', 'Are you sure?', 'onConfirm', this);
Ext.Msg.confirm({
title: 'Confirm',
msg: 'Are you sure?',
buttons: Ext.Msg.OKCANCEL,
fn: this.onConfirm,
icon: Ext.MessageBox.QUESTION,
config: {
grid: grid,
action: 'del',
store: store
}
});
},
onConfirm: function(btn, text, opt) {
console.log(opt.config.action)
if (btn === 'ok') {
//
opt.config.grid.item.remove();
Ext.Ajax.request({
url: 'http://localhost:8080/' + opt.config.action + '/' + opt.config.grid.record.data.id,
// method: 'DELETE', //this is the url where the form gets submitted
useDefaultXhrHeader: false,
success: function(form, action) {
opt.config.store.load({
start: 0,
limit: 5
})
},
failure: function(form, action) {
},
listeners: {
doRefresh: function() {
this.doLoad(this.cursor);
},
}
});
}
}
});
Please find the screenshot here
Doing grid.getStore().reload() should be sufficient.
BTW. The doRefresh listener is weird. Are you sure you wanted this as Ext.Ajax.request config? This doesn't make sense to me.

Data binding associations in ExtJS admin template

I'm unsuccessful in getting binding associations working in the admin dashboard template (with the desired behavior of selecting a record from a combobox and pulling up associated records in a grid).
My main viewModel is defined as:
Ext.define('Admin.view.main.MainModel', {
extend: 'Ext.app.ViewModel',
alias: 'viewmodel.main',
stores: {
patients: {
model: 'md_registry.model.Patient',
autoLoad: true
}
}
});
I added a leaf node to Pages in NavigationTree.js:
{
text: 'Pages',
iconCls: 'x-fa fa-leanpub',
expanded: false,
selectable: false,
//routeId: 'pages-parent',
//id: 'pages-parent',
children: [
{
text: 'Proc',
iconCls: 'x-fa fa-send',
rowCls: 'nav-tree-badge nav-tree-badge-hot',
viewType: 'procedure',
leaf: true
}]
}
With the procedure view being:
Ext.define('Admin.view.pages.Procedure', {
extend: 'Ext.panel.Panel',
xtype: 'procedure',
requires: [
'Ext.panel.Panel',
'Admin.model.Patient',
'Admin.model.Procedure'
//'Admin.model.Diagnosis'
],
anchor : '100% -1',
referenceHolder: true,
width: 1000,
height: 1000,
referenceHolder: true,
layout: {
type: 'hbox',
align: 'stretch'
},
viewModel: 'main',
session: {},
items: [
// https://www.sencha.com/forum/showthread.php?299301-Bind-combobox-displayField-value-to-displayfield
{
xtype: 'fieldset',
layout: 'anchor',
items: [{
xtype: 'combobox',
listeners : {
select : function() {
console.log(arguments)
console.log(arguments[1].data.birth_date)
console.log(arguments[1].data.first_name)
console.log(arguments[1].data.last_name)
console.log(arguments[1].data.sex)
}
},
bind: {
store: '{patients}'
},
reference: 'patientCombo',
publishes: 'id',
fieldLabel: 'Patient Search',
displayField: 'mrn',
//anchor: '-',
// We're forcing the query to run every time by setting minChars to 0
// (default is 4)
minChars: 2,
queryParam: '0',
queryMode: 'local',
typeAhead: true,
// https://www.sencha.com/forum/showthread.php?156505-Local-combobox-with-any-match-filter
doQuery: function(queryString, forceAll) {
this.expand();
this.store.clearFilter(!forceAll);
if (!forceAll) {
this.store.filter(this.displayField, new RegExp(Ext.String.escapeRegex(queryString), 'i'));
}
}
}, {
// https://www.sencha.com/forum/showthread.php?299301-Bind-combobox-displayField-value-to-displayfield
xtype: 'displayfield',
fieldLabel: 'Selected Patient',
bind: {
html: '<p>Name: <b>{patientCombo.selection.first_name}, ' +
'{patientCombo.selection.last_name} </b></p>' +
'<p>Sex: {patientCombo.selection.sex}</p>' +
'<p>Birthdate: {patientCombo.selection.birth_date}</p>'
}
}]
},
{
title: 'Procedures',
xtype: 'grid',
bind: '{patientCombo.selection.procedures}',
flex: 1,
margin: '0 0 0 10',
columns: [{
text: 'Procedure Date', dataIndex: 'proc_date', flex: 1
}, {
text: 'Procedure', dataIndex: 'proc_name', flex: 1
}],
plugins: [{
ptype: 'rowexpander',
rowBodyTpl : new Ext.XTemplate(
'<p><b>Proc Name Orig:</b> {proc_name_orig}</p>',
'<p><b>Proc Code:</b> {proc_code}</p>',
'<p><b>Proc Code Type:</b> {proc_code_type}</p>')
}],
viewConfig: {
emptyText: 'No procedures',
deferEmptyText: false
}
}]
});
My Patient and Procedure models are simply:
Ext.define('Admin.model.Procedure', {
extend: 'Ext.data.Model',
idProperty: 'id',
fields: [
//{ name: 'id', type: 'string' },
{ name: 'proc_code', type: 'string' },
{ name: 'proc_name', type: 'string' },
{ name: 'proc_code_type', type: 'string' },
{ name: 'proc_name_orig', type: 'string' },
{ name: 'proc_date', type: 'date', format: 'Y-m-d' },
{
name: 'patient_id',
type: 'string',
reference: {
parent: 'Admin.model.Patient',
//type: 'md_registry.model.Patient',
inverse: 'procedures',
autoLoad: false
}
}
],
proxy: {
type: 'rest',
url: 'http://127.0.0.1:5000/procedureview/api/read',
reader: {
type: 'json',
rootProperty: ''
}
}
});
and
Ext.define('Admin.model.Patient', {
extend: 'Ext.data.Model',
requires: [
'Ext.data.proxy.Rest'
],
fields: [
{ name: 'id', type: 'string' },
{ name: 'mrn', type: 'string' },
{ name: 'birth_date', type: 'date', format: 'Y-m-d' },
{ name: 'sex', type: 'string' },
{ name: 'first_name', type: 'string' },
{ name: 'last_name', type: 'string' }
],
proxy: {
type: 'ajax',
url: 'http://127.0.0.1:5000/patientview/api/read',
reader: {
type: 'json',
rootProperty: ''
}
}
});
respectively.
The data for my Patients store are getting loaded into the combobox just fine, but when I select an item from the combo list it is not firing off the call to grab the associated procedures data (see image: .
However, the binding associations work as expected with Side Navigation Tabs (see image: , and show up within the object prototype chain, as expected... see
(whereas for the admin dashboard, the associations are empty).
I cannot for the life of me get these working in the Admin Dashboard. I noticed a tool called the bind inspector, but I am running the GPL version of the SDK, so I do not have access to this. Beyond this, I cannot figure out a way to debug why the binding association is not working in the admin dashboard, but otherwise works perfectly well in Side Navigation Tabs.
I would set up a Fiddle, but I have no idea how to do it using the Admin Template.
I just figured it out. It was a namespace issue.
My reference in the procedure model should be:
reference: {
parent: 'Patient',
inverse: 'procedures',
autoLoad: false
}
Voila, all the associated data get loaded as expected!

Combobox ignores autoLoad [Extjs]

i'm trying to make that a combo load the items (dataStore) with AutoLoad: true, but, i don't know if i'm doing this right. I'm a little newbie with Extjs, so, don't be rude, please hehe
here's the code!
items: [{
xtype: 'form',
padding: 20,
name: 'formReplyParameters',
layout: 'anchor',
fieldDefaults: {
msgTarget: 'under',
labelAlign: 'top'
},
defaults: {
padding: 10
},
items: [{
xtype: 'checkboxfield',
name: 'interactive',
inputValue: true,
fieldLabel: 'Interactive',
anchor: '100%'
}, {
xtype: 'textfield',
name: 'timeResponse',
fieldLabel: 'Time response',
anchor: '100%'
}, {
xtype: 'combobox',
fieldLabel: 'Alert channel',
name: 'uuidResponseParameterType',
queryMode: 'local',
store: new Ext.data.Store({
fields: [{
name: 'description',
type: 'string'
}, {
name: 'name',
type: 'string'
}, {
name: 'uuid',
type: 'string'
}],
autoLoad: true,
hideTrigger: true,
minChars: 1,
triggerAction: 'query',
typeAhead: true,
proxy: {
type: 'ajax',
url: "../blabla",
actionMethods: {
create: "POST",
read: "POST",
update: "POST",
destroy: "POST"
},
extraParams: {
action: "catalog",
catalog: "parametersType",
params: JSON.stringify({
uuidToken: Ext.connectionToken
})
},
reader: {
type: 'json',
root: 'List'
},
listeners: {
exception: function(proxy, response, operation, eOpts) {
var responseArray = JSON.parse(response.responseText);
Ext.Notify.msg(responseArray.message, {
layout: "bottomright",
delay: 5000,
type: "error"
});
}
}
}
}),
anchor: '100%',
typeAhead: true,
triggerAction: 'all',
valueField: 'uuid',
displayField: 'description',
allowBlank: false,
listeners: {
change: function (combo, value) {
var type = combo.valueModels[0].data.name;
var channel = me.down('[name="uuidChanel"]');
channel.clearValue();
var channelStore = new Ext.data.Store({
fields: [{
name: 'description',
type: 'string'
}, {
name: 'name',
type: 'string'
}, {
name: 'uuid',
type: 'string'
}],
autoLoad: true,
hideTrigger: true,
minChars: 1,
triggerAction: 'query',
typeAhead: true,
proxy: {
type: 'ajax',
url: "../handler/custom/customEvent.ashx",
extraParams: {
action: "catalog",
catalog: type,
params: JSON.stringify({
uuidToken: Ext.connectionToken
})
},
reader: {
type: 'json',
root: 'list'
},
listeners: {
exception: function(proxy, response, operation, eOpts) {
var responseArray = JSON.parse(response.responseText);
Ext.Notify.msg(responseArray.message, {
layout: "bottomright",
delay: 5000,
type: "error"
});
}
}
}
});
channelStore.load();
channel.bindStore(channelStore);
}
}
}, {
xtype: 'combo',
name: 'uuidChanel',
fieldLabel: 'Channel',
valueField: 'uuid',
displayField: 'description',
anchor: '100%',
store: null,
allowBlank: false
}]
}]
The problem is in the combo: uuidChannel
if anyone can help, thanks a lot!
Why exactly you think that autoLoad: true doest work? Because when you try to open last combobox picker its still loading?
I think your problem is that new store created every time combo name: 'uuidResponseParameterType' change event trigger and store autoLoad: true means that
store's load method is automatically called after creation
You have to create store just once and load (or filter locally) it with new extraParams on combo change event.
The thing is that (stupid)
channel.clearValue();
this field was doing all the problem. this "clearValue" was there because I believed that deleting the data of "uuid", it was returning me the new data with the "bind" to the bottom
channelStore.load();
channel.bindStore(channelStore); <<<
So, I think i put the new data, but this "clearValue", just was erasing the data with the "bind" I had down. So, i just elimite that channel.clearValue(); , and that's solves the problem! :)

extjs treegrid displaying empty grid columns

I am trying to get a really basic tree grid working but all I get is an empty panel.
I copied the json string from a working treepanel example and added the date and filename myself for the extra grids.
So calling the bits root and children worked for a basic panel (i had it working when it only had the field text and was directly in the store. So i presumed it would work for a tree grid.
After searching I found that a treestore doesn't have a data config it had to be moved to the proxy. Now I just have empty date and filename columns.
so here is my model
Ext.define('Coda.common.repository.model.RepositoryMaintModel',{
extend: 'Ext.data.Model',
fields: [
{name: 'date', type: 'string'},
{name: 'filename', type: 'string'},
{name: 'text', type: 'string'},
{name: 'iconCls' , type: 'string', defaultValue: 'treenode-no-icon'},
{name: 'expanded' , type: 'boolean', defaultValue: true, persist: false},
{name: 'index' , type: 'int'}
]
});
and here is my view
Ext.define('view.RepositoryMaintView', {
extend: 'U4.panel.Panel',
requires: ['Ext.layout.container.HBox',
'model.RepositoryMaintModel',
'Ext.tree.Panel'],
EVENT_DOWNLOAD: 'download',
layout: 'hbox',
constructor: function (config) {
var me = this;
me.addEvents(
/**
* #event download
* #param {view.RepositoryMaintView} when pressing the download button
*/
me.EVENT_DOWNLOAD
);
var data = {root: {
expanded: true,
root: [
{ text: "detention",date:'10-01-2013', filename:'boo.txt', leaf: true },
{ text: "homework",date:'10-01-2013', filename:'boo.txt', expanded: true,
root: [
{ text: "book report",date:'10-01-2013', filename:'boo.txt', leaf: true },
{ text: "algebra",date:'10-01-2013', filename:'boo.txt', leaf: true}
] },
{ text: "buy lottery tickets",date:'10-01-2013', filename:'boo.txt', leaf: true }
]
}};
var store = Ext.create('Ext.data.TreeStore', {
model: 'blah.blah.model.RepositoryMaintModel',
// data: data, <-- remove from here
proxy: {
type: 'memory',
data: data, // <-- place here
reader: {
type: 'json',
root: 'root'
}
},
folderSort: true
});
var center = Ext.create('Ext.tree.Panel',{
title: 'Folders Companies Items',
//region: 'center',
width: 1000,
height: 200,
collapsible: false,
useArrows: true,
rootVisible: false,
store: store,
multiSelect: true,
columns: [
{
xtype: 'treecolumn', //this is so we know which column will show the tree
text: 'hmm',
flex: 2,
sortable: true
},{
text: 'Date',
sortable: true,
dataIndex: 'date'
},{
text: 'filename',
sortable: true,
dataIndex: 'filename'
}]
});
me.items = [center];
me.callParent(arguments);
}
});

Sencha Touch toolbar duplicating

I'm new with Sencha Touch 2 and I've got a trouble using nested list:
toolbar duplicates along with back button, so at the end of nested list I have 3 toolbars with 3 back buttons. I guess that the reason is that I create Ext.nestedList for each detailed card, useToolbar:false doesn't fix the problem because then I can't go to previous list. Maybe back button needs to be overwritten but I've got no idea of that. Any help would be very useful. Here is top part of code:
Ext.define('ListItem', {
extend: 'Ext.data.Model',
config: {
fields: ['text'],
},
});
var treeStore = Ext.create("Ext.NestedList", {
fullscreen: true,
tabBarPosition: 'bottom',
title: 'Now-Yakutsk',
iconCls: 'star',
displayField: 'title',
layout: 'card',
store: {
type: 'tree',
id: 'ListCard',
fields: [
'title','code',
{name: 'leaf', defaultValue: true}
],
root: {
leaf: false
},
proxy: {
type: 'jsonp',
url: 'http://now/catlist.php',
reader: {
type: 'json',
rootProperty: 'cat'
}
}
},
listeners: {
leafitemtap: function(nestedList, list, index, target, record) {
var treeStore2 = Ext.create("Ext.NestedList", {
fullscreen: true,
tabBarPosition: 'bottom',
//useToolbar:false,
//leaf: true ,
iconCls: 'star',
displayField: 'title',
store: {
type: 'tree',
id: 'detailCard',
fields: [
'title','code','link',
{name: 'leaf', defaultValue: true}
],
root: {
leaf: false
},
proxy: {
type: 'jsonp',
url: 'http://now/catlist2.php',
reader: {
type: 'json',
rootProperty: 'cat'
}
}
},
detailCard: { useToolbar:true,
xtype: 'panel',
scrollable: true,
styleHtmlContent: true
},
listeners: {
leafitemtap: function(nestedList, list, index, target, record) {
var cin = Ext.create("Ext.NestedList", {
fullscreen: true,
tabBarPosition: 'bottom',
//useToolbar:false,
//title: 'Blog',
iconCls: 'star',
displayField: 'list',
store: {
type: 'tree',
fields: [
'name', 'link', 'list', 'image', 'adress', 'banner',
{name: 'leaf', defaultValue: true}
],
root: {
leaf: false
},
proxy: {
type: 'jsonp',
url: 'http://now/cinemalist.php',
reader: {
type: 'json',
rootProperty: 'cinema'
}
}
},
detailCard: {
xtype: 'panel',
scrollable: true,
styleHtmlContent: true
},
listeners: {
leafitemtap: function(nestedList, list, index, element, post) {
this.getDetailCard().setHtml(post.get('banner'));
}
}
});
and the screenshot:
http://piccy.info/view3/4985552/cdfd1dcca3928d4a5d4b4b41ba060b1f/
found solution in case someone else has the same problem
-the point is hiding and showing the toolbar playing with active deactive methods
for example in parent we create
listeners: { activate : function() {
//this.getToolbar().hide();
tb = this.getToolbar();
} ,
deactivate: function() {
//this.getToolbar().hide();
}
then in child we put
listeners: {
activate : function() {
tb1 = this.getToolbar();
tb1.hide();
tb.show();
//this.getToolbar().hide();
} ,
deactivate: function() {
//tb.show();
//alert('dd');
//this.getToolbar().hide();
}
and so on ...

Resources