-
26 Aug 2010 11:00 PM #1
loops in Extjs
loops in Extjs
hi......
how to use loops in Extjs
i want use loop to print 26 buttons for a to z in tbar
if any one knows solution or ideas help me
-
26 Aug 2010 11:04 PM #2
Well, if you did it manually, you'd use:
So just write a loop to produce that same array!Code:var toolbar = new Ext.Toolbar({ items: [{ text: 'a' },{ text: 'b' }, { // ....... text: 'z' }] });Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
27 Aug 2010 12:50 AM #3
-
27 Aug 2010 1:07 AM #4
you can use character codes. A-Z 65-90, a-z 97-122. This is just a snippet from a plugin I had found on the site. Do a forum search for GridAZFilter
MartyCode:for (var i=65; i<91; i++) { items.push({ text: String.fromCharCode(i), enableToggle: true, toggleGroup: 'AZfilter', toggleHandler: this.buttonToggleHandler, scope: this }); }
-
22 Nov 2012 1:33 AM #5
Can you explain it in details bit more? where shall i use this loop?
-
22 Nov 2012 5:05 PM #6
You should add the code before the toolbar instance.
Code:var yourItemsArray = []; //loop for(....) {....} var toolbar = new Ext.Toolbar({ items: yourItemsArray });Greivin Britton
My Extensions:
Ext.ux.NumericField: Number field with support for currencySymbol, thousand separator, international...
Ext.ux.PagerSizeSelector: A plugin that allows the change page size with just one click.
Ext.ux.FieldAccess: A plugin to let the user know which fields are editable.
Similar Threads
-
Passing arguments -- Refer Extjs In action book and ExtJs sample code
By mrag74 in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 28 Apr 2011, 2:11 PM -
[SOLVED] How to use for-loops in XTemplate
By n3rd in forum Ext 3.x: Help & DiscussionReplies: 8Last Post: 20 May 2010, 5:07 AM -
Stop using for each loops
By TheBuzzer in forum Community DiscussionReplies: 1Last Post: 15 Dec 2009, 10:54 PM -
[UNKNOWN]Substitution of Ext.Each with loops
By Animal in forum Ext 3.x: BugsReplies: 5Last Post: 1 Nov 2009, 11:23 PM -
How to use two loops in MasterTemplate?
By justmonkey in forum Ext 1.x: Help & DiscussionReplies: 3Last Post: 24 May 2007, 1:43 AM


Reply With Quote
