I have a tabstrip with two tabs. In the first tab, I have button named "Show grid". After clicking that button it will render a grid along with a back button to go back to the previous view that contained only the "show grid" button. The problem is how can I go back using this back button?
<body>
<div id="tabstrip">
<ul>
<li id="tab1">Tab 1</li>
<li id="tab2">Tab 2</li>
</ul>
<div>
<button class='k-button'>Show grid</button>
<div id="button1"></div>
<div id="grid"></div>
</div>
<div>Content 2</div>
</div>
<script>
function grid() {
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
dataSource: {
data: [
{ name: "Jane Doe", age: 30 },
{ name: "John Doe", age: 33 }
]
}
});
}
var tabStrip = $("#tabstrip").kendoTabStrip().data("kendoTabStrip");
$(".k-button").one("click", function() {
$("#button1").append('<button>Click</button>');
grid();
});
</script>
</body>
Try this , in this example I used the same button, however following the same logic you can create a new one keeping both