-
2 Feb 2012 4:57 AM #1
Answered: How to add arrow to nestedList
Answered: How to add arrow to nestedList
How to add arrow to nestedList ???
-
Best Answer Posted by mitchellsimoens
You can override the getItemTextTpl method to provide a string. This string will later be added to the itemTpl of the lists. Hopefully you can simply add a new element and float it to the right and style it:
Code:getItemTextTpl : function(node) { return '{' + this.displayField + '}<div class="list-arrow"></div>'; }Code:.list-arrow { float : right; height : 1em; width : 1em; background-image: url(...); }
-
2 Feb 2012 12:48 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
Where do you want this arrow to be? On a non-leaf list item?
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 Feb 2012 3:03 AM #3
yes
I on the right arrow to make it (non-leaf)
-
3 Feb 2012 5:52 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
You can override the getItemTextTpl method to provide a string. This string will later be added to the itemTpl of the lists. Hopefully you can simply add a new element and float it to the right and style it:
Code:getItemTextTpl : function(node) { return '{' + this.displayField + '}<div class="list-arrow"></div>'; }Code:.list-arrow { float : right; height : 1em; width : 1em; background-image: url(...); }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 Feb 2012 6:44 AM #5
ok work ...
thx
PHP Code:Ext.require(
[
'Ext.data.Model',
'Ext.data.TreeStore',
'Ext.app.Application',
'Ext.field.TextArea',
'Ext.dataview.NestedList'
],
function() {
Ext.override(Ext.dataview.NestedList, {
getItemTextTpl: function(node) {
return '{' + this.getDisplayField() + '}<div class="list-arrow"></div>';
}
});
});
-
3 Feb 2012 6:45 AM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
Fantastic!
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 Feb 2012 7:18 AM #7
this.getDisplayField() ---- NOT: this.displayField!
thx


Reply With Quote