Hi,
I cannot figure out how to resolve following issue. I’m developing dynamic application. I need to add tabs at runtime and remove them if user press close button. But instead of desired behavior I got following. I have created a few tabs and when I’m pressing a close button at any tab the first tab is closed – always.
Here is steps how to reproduce or view fiddle (http://jsfiddle.net/075ace8d/):
html:
<input type="button" value="Add" id='jqxCreateButton' />
<p>
if you press Add botton twice and then press close button on the last tab the first one will be closed
</p>
<div id='jqxWidget'>
<div id='jqxTabs'>
<ul>
<li>First</li>
</ul>
<div></div>
</div>
</div>
JavaScript:
$('#jqxTabs').jqxTabs({ width: 580, height: 200, showCloseButtons: true });
$("#jqxCreateButton").jqxButton({ width: 120, height: 25 });
$('#jqxTabs').jqxTabs('removeFirst');
index=0;
$("#jqxCreateButton").on("click", function() {
$('#jqxTabs').jqxTabs('addFirst', 'Sample title ' + index++, "Text "
+ index);
$('#jqxTabs').jqxTabs('ensureVisible', -1);
});
Any thoughts?