从选项卡中的链接附加到选项卡

时间:2009-09-10 20:46:00

标签: jquery

考虑到jqGrid [http://trirand.com/jqgrid/jqgrid.html]作者的示例格式,如何在选项卡[#RightPane]中添加一个链接以附加到选项卡上?并且,新标签显示AJAX内容吗?

1 个答案:

答案 0 :(得分:0)

这应该让你开始:

<script type="text/javascript">
        $(function() {

        //this sets up the tabs
         $("#theTabs").tabs();

//this attaches the new tab functionallity to the link
            $("#AddTabLink").click(function() {
                $("#theTabs").tabs("add", "the url you want to load ajaxly", "The New Tab title");
            }
            );

        });
    </script>


and this is the link that will have the addtab functionality applied to it. this could go on an existing tab,  or somewhere else on the page.

<a href="#" id="AddTabLink">Click Here</a>