javascript - Referencing an element drawn in the main App -
i writing rally app in have rallychart , button. need access chart , modify setting on button click. button in same app container rallychart.
i tried ext. this. etc. these access specifiers not work. please me this?
sample code:
ext.define('customapp', { extend: 'rally.app.app', componentcls: 'app', id: 'appid', launch: function () { var datepickerfrom = ext.create('ext.container', { items: [{ xtype: 'rallytextfield', fieldlabel: 'enter start date chart (mm/dd/yyyy): ', labelwidth: 150 }], renderto: ext.getbody().dom, id: 'd1' }); this.add(datepickerfrom); this.add( { xtype: 'rallychart', height: 400, width: 800, id: 'chart1', itemid: 'chart1', chartconfig: chartconfig, renderto: ext.getbody().dom } ); button2 = { xtype: 'rallybutton', text: 'plot graph', handler: function () { console.clear(); console.log("clicking button"); // need access chart here or textfield data here }, callback: function(){ } }; this.add(button2);
you may reference them via itemid. after itemid on element set:
this.add( { xtype: 'rallychart', height: 400, itemid: 'mychart', chartconfig: {//...} //... }
it can used reference element:
this.down('#mychart')
Comments
Post a Comment