jquery - Javascript - Dynamically added tabs not seen as tabs in Kendo panelbar -
ok, first off read in encrypted file datasource, converted xml string.
the data displays in grids, except panels dynamically added panelbar not seem act such seen in fiddle.
they added to:
<ul id='panelbar'> <li id='patdet' class='k-state-active'> <span class='k-link k-state-selected'><input type='checkbox' id='cpatientdetails' /><label for='cpatientdetails'><a href='#' id='cbselect'></a>patient detail</label></span> <div id='pattab'></div> </li> </ul> like so:
$("<li id = '"+ liid +"' class='k-item k-state-default' role='menuitem' aria-expanded='false' aria-hidden='true'><span class='k-link k-header'><input type='checkbox' id='c" + x + "' class='cbselect' /><label for='c" + x + "'><a href='#' id='cbselect''></a>" + lititle + "</label></span></li>").appendto("#panelbar"); $("<div id = 'gridgenerate" + x + "' width='400px;' aria-hidden='true'></div>").appendto("#" + liid); the reason span , link styling can used on checkbox can found in fiddle.
at first used hard coded datasource, worked perfectly, when switched on fetching data using request, data displays should, except panelbar.
this looks like:
when first tab should open. created panelbar so:
$("#panelbar").kendopanelbar( { expandmode: "single" }); edit
i've made panelbar , grids created once data retreived , converted, issue remains.
any idea why happening?
when kendoui adds tab, more adding html tags. that's why have methods adding tabs on demand.
instead of adding html hand try using:
var panelbar = $("#panelbar").data("kendopanelbar"); panelbar.append([ { text: "<label for='c" + x + "'>" + "<a href='#' id='cbselect''></a>" + "" + lititle + "" + "</label>", encoded: false, content: "<div>text</div>" } ]); click here see in jsfiddle.
Comments
Post a Comment