-
29 Jul 2008 4:48 AM #1
Re-render
Re-render
How in extjs can I re-render my component? I am extending Ext.BoxComponent and I want to re-render my object after calling setColor method. This is my code:
Code:MyColorField = Ext.extend(Ext.BoxComponent,{ color: 'FFFFFF', initComponent: function() { Ext.apply(this, {}); MyColorField.superclass.initComponent.apply(this, arguments); }, onRender: function(ct, position) { this.colorField = Ext.DomHelper.append(ct, { tag: 'div', style:'border-style:solid; ' + 'border-width:1px; ' + 'border-color:#990000; ' + 'width:12px; ' + 'height:12px; ' + 'background-color: #'+ this.color }); MyColorField.superclass.onRender.call(this, ct, position); }, setColor: function(color) { this.color = color; }, getColor: function() { return this.color; } })
-
29 Jul 2008 5:55 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
why re-render?
why not just set the CSS attribute?
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
29 Jul 2008 5:57 AM #3
Agreed with the above. Re-rendering is generally not supported.
Why go through so much effort?Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
29 Jul 2008 6:10 AM #4
Thanks. I understand. But what happen if I edit a cell in EditorGridPanel? Isn't each cell rerender then?
-
29 Jul 2008 6:12 AM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
you're comparing apples with bananas.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
29 Jul 2008 6:16 AM #6
Why? Please explain that.
-
29 Jul 2008 6:23 AM #7
render !== update
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
29 Jul 2008 6:33 AM #8


Reply With Quote