javascript - What is tpl and how do I interprete it in extJS context? -


ext.define('app.view.util.navigationview', {     extend: 'ext.panel.panel',      tpl: [''         ,'<ul class="app-navigation-container">'         , '<tpl for=".">'         , '<a href="#{navigationtoken}">'         ,'<li class="app-navigation-pane {iconcls}">'         , '<h2>{title}</h2>'         , '<p>{description}</p>'         , '</li>'         , '</a>'         , '</tpl>'         , '</ul>'         , '<div class="x-clear"></div>'     ] }); 

i new extjs , debugging small client-side issues involved extjs. how can update navigationtoken variable in other files. have listeners 'select' listener in change value navigationtoken.

your component has property called 'data', part of extended panel. property used provide template defined in 'tpl' data, can set property.

so in listener can set data property calling

var data = [{     navigationtoken: 'navigationtoken1',     iconcls: 'iconcls',     title: 'title1',     description: 'description1' }, {     navigationtoken: 'navigationtoken1',     iconcls: 'iconcls',     title: 'title2',     description: 'description2' }];  [view].update(data); 

where [view] should references 'app.view.util.navigationview'.


Comments