jQWidgets Forums
jQuery UI Widgets › Forums › Plugins › AngularJS › Why Controls is not working when using getContent in jqxTabs.
Tagged: angularjs tab
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 10 years, 7 months ago.
-
Author
-
<!DOCTYPE html> <html ng-app="demoApp"> <head> <title id="Description">jqxTabs Directive for AngularJS</title> <link rel="stylesheet" type="text/css" href="../css/jqx.base.css" /> <script src="../Tools/angular.min.js"></script> <script src="../Tools/jquery-1.11.1.min.js"></script> <script src="../Tools/jqxcore.js"></script> <script src="../Tools/jqxtabs.js"></script> <script src="../Tools/jqxdatetimeinput.js"></script> <script src="../Tools/jqxcalendar.js"></script> <script src="../Tools/globalize.js"></script> <script src="../Tools/jqxangular.js"></script> <script type="text/javascript"> var demoApp = angular.module("demoApp", [ "jqwidgets" ]); demoApp.controller("demoController", function($scope) { $('#jqxTab').on( 'tabclick', function(event) { var tabclicked = event.args.item; var title = $('#jqxTab').jqxTabs('getTitleAt', tabclicked); if (title == "+") { var content = $('#jqxTab').jqxTabs('getContentAt', 0); $('#jqxTab').jqxTabs('addAt', tabclicked, 'Tab', content.html()); } }); }); </script> </head> <body> <div ng-controller="demoController"> <jqx-tabs id="jqxTab"> <ul> <li>Tab 1</li> <li id="addNewTab">+</li> </ul> <div> <jqx-date-time-input></jqx-date-time-input> </div> <div></div> </jqx-tabs> </div> </body> </html>
Here i am trying to get the content from Tab-1 and set that content for New Tab but new Tab control is not working.
Hello Kavyad23,
HTML is not a widget. A widget is HTML, JavaScript and CSS which makes that HTML dynamic and styled. You use content.html().
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
Thanks for your reply. I want to take all the content from first Tab and add that content to second tab when I click Add new. how to achieve this?
Hi Kavyad23,
I do not think that this is possible. You should create a new content. You cannot move it.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.