PDA

View Full Version : About renderTpl in grid



leilei_2014
15 Dec 2014, 11:49 PM
Hello,

I am using Extjs 4.2

Recently I read the source code of grid.Panel. I found that the 'renderTpl'(it is an array) property has been converted to an instance of XTemplate before constructor run.

Can anyone tell me when the 'renderTpl' is converted to an XTemplate?

Thanks in advance.

skirtle
17 Dec 2014, 3:56 AM
See:

Ext.util.Renderable - initRenderTpl.

Ext.XTemplate - getTpl.

The key trick is that getTpl updates the prototype. This is a performance enhancement to ensure the template only needs compiling once.

leilei_2014
17 Dec 2014, 7:27 PM
i see, thank you very much