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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -