javascript - Extjs 5.1 Dynamic addition of container to panel -
what trying dynamically add container panel on click of button.
1st instance of container gets added , can seen in panel.items.length
2nd instance onwards panel.items.length doesn't change. panel can seen in dom , on screen.
just wanted know why panel.items.length not increasing. bug?
fiddler link https://fiddle.sencha.com/#fiddle/p3u
check line :
console.log(qitems);
below debugger; set questionsblock.items.length talking about.
remove itemid questiontemplate , remove renderto new instance.
your click handler should this:
listeners: { 'click': function(button) { var questionpanel = button.up('form').down('#questionsblock'), qitems = questionpanel.items.length, questiontemplate = ext.create('questiontemplate', { qid: qitems, questiontype: 'text' }); console.log(qitems); questionpanel.add(questiontemplate); questionpanel.dolayout(); } }
check fiddle: https://fiddle.sencha.com/#fiddle/p47
Comments
Post a Comment