-
30 Apr 2012 1:41 AM #1
Answered: nestedlist
Answered: nestedlist
Hola:
como puedo enlazar a cada nodo de una lista anidada y nueva vista (.js) . Este es el código que tengo
Gracias por su ayuda.Code:Ext.define('Mtp.store.Demos', { extend: 'Ext.data.TreeStore', requires: ['Mtp.model.Demo', 'Mtp.view.Agilidad'], config: { model: 'Mtp.model.Demo', defaultRootProperty: 'items' , root:{ items: [ { text: 'Agilidad', items: [ { text: 'Agilidad505', view: 'Agilidad',// Lo he intentado así , pero no sale }, { text: 'Agilidad Illinois', id: 'agilidadillinois', }, { text: 'Cambio de dirección lateral', id: 'direclateral' }, { text: 'Prueba rapida de pies', id: 'rapidadepies' }, { text: 'Zig-Zag', id: 'zigzag' }] }], } } });
-
Best Answer Posted by mitchellsimoens
So you want when you tap on Agilidad505 to display a view based on the view data?
-
2 May 2012 5:01 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
So you want when you tap on Agilidad505 to display a view based on the view data?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
3 May 2012 3:09 AM #3
view (.js) not data view
view (.js) not data view
I wish that when you click on Agillidad505 show a view .js a calculator is not a Data View
-
9 May 2012 6:48 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
If it is a leaf it will go to the detailCard you can specify in the detailCard config of the nestedlist. You can use leafitemtap event on the nestedlist to apply data to the detailCard.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
15 May 2012 8:13 AM #5
I triedlike this:
Ext.define('Mtp.view.Calculadora', {extend: 'Ext.NavigationView',
//requires: ['Mtp.view.Agilidad505'],
xtype: 'calculadora',
config:
{
title: 'Calculadoras',
iconCls: 'bookmarks',
//autoDestroy: false,
items:[{
xtype:'nestedlist',
//itemTpl: '{title}',
title:'Caculadoras',
store:'Demos',
detailCard: {
xtype:'panel',
scrollable: true,
styleHtmlContent: true,
},
listeners: {
leafitemtap: function(nestedList, list, index, element, post, view) {
this.getDetailCard().setHtml(post.get('view'));
}
}
}]
}
});
but I write takes its name from the view (examle if the view is view: 'Agilidad505' from the end of the road I get only "Agilidad505") and does not lead me to the view that name is (Mtp. view.Agilidad505), saved as Agilidad505.js
-
15 May 2012 8:37 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
You can use add() to add a component to the detail card based on selection or setDetailCard to replace the detail card within the leafitemtap event listener.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
17 May 2012 9:03 AM #7
I did like this:
Code:Ext.define('Mtp.view.Calculadora', {extend: 'Ext.NavigationView', xtype: 'calculadora', config: { tab: { title: 'Calculadoras', iconCls: 'bookmarks', scrollable: true, //text:'Calculadoras' }, items:[{ title:'Categorias', xtype:'nestedlist', store:'Demos', listeners: { leafitemtap: function(nestedList, list, index, element, post, view) { var me = list.getParent(), store = list.getStore(), record = store.getAt(index); byXtype = record.get('xtype'); title: record.get('title'); var name = record.get('view'), ns = 'Mtp.view.'; // BUILD THE VIEW view = Ext.create(ns + name, { title: record.get('text'), }); console.log(ns + name); // ATTACH THE VIEW AS A PANEL to the Tabbed View var calculadorPanel = Ext.getCmp(byXtype) || view calculadorPanel.setRecord(list.getStore().getAt(index)); if (!calculadorPanel.getParent()) { // Go to the newly created panel with our custom view this.parent.setActiveItem(calculadorPanel, 'slide');//Ext.NavigationView.add(editorPanel); } calculadorPanel.show(); } } }] }, getViewName: function(item) { var name = item.get('name') || item.get('text'), ns = 'Mtp.view.'; return ns + name; }, });
Now I want the title of the nestedlist not repeat, I have this:
pantallaapp.jpg
I want a different top or the bottom
-
21 May 2012 12:47 AM #8
-
21 May 2012 4:50 AM #9Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
One is for the navigation view and the other is for the nestedlist. If you don't want the one for nestedlist then use the toolbar config
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
23 May 2012 9:14 AM #10
I could not do it, I want the title"Calculadoras" in the navigation view and the title "Categorias" in the nestedlist


Reply With Quote