Hi Chinthaka,
Thanks for the update.
In the last update, we have given the sample for Tab mobile control and it doesn’t work in Tab Web control. We can add the tab dynamically by using addItem() public method of Tab Web control. And the method has the option to set the tab id for the new tab. On using that tab id, we can add the grid to the content of the newly added tab. Please find the code below code example.
To add the New tab item Dynamically:
<code> var tabObj = $("#defaultTab").data("ejTab"); tabObj.addItem("#new", "New Tab", 2, "myClass", "newItem"); </code> |
To insert the grid into the newly added tab item:
$("#newItem").ejGrid({ dataSource: dm, allowPaging:true, columns: ["OrderID", "EmployeeID", "CustomerID", "ShipCountry", "Freight"] }); |
In the above code, we have inserted the new tab dynamically by using addItem() method and passed “newItem” as tab id to the argument of the method. And using that tab id, we have rendered the grid and by default, it will be inserted to the tab content on matching the tab id.
We have prepared the sample based on your requirement. Please find the sample link below.
Other References:
Please let us know if you need any further assistance.
Regards,
Dhivyalakshmi.