使用jquery easyui,如何通过选项卡中的链接创建选项卡?
标签文件
我想从选项卡中的链接创建一个新选项卡。
例如,在标签a中,有一个链接“打开标签b”,它应该添加标签b,
当链接不在选项卡中时,我尝试了创建选项卡的方式(这是有效的)
但是,在这种情况下,当我按它时,它没有响应。 谢谢
Manage List
addtabfunction
function addTab(title, url){ if ($('#tt').tabs('exists', title)){ $('#tt').tabs('select', title); } else { var content = ''; $('#tt').tabs('add',{ title:title, content:content, closable:true }); } }
完整页面
@import "../plugin/easyui/themes/default/easyui.css"; @import "../plugin/easyui/themes/icon.css"; @import "../plugin/bootstrap/css/bootstrap.css"; @import "../plugin/bootstrap/css/bootstrap-responsive.css"; @import "../style/form.css"; $(document).ready(function(){ $("#addlist").validate(); }); function addTab(title, url){ if ($('#tt').tabs('exists', title)){ $('#tt').tabs('select', title); } else { var content = ''; $('#tt').tabs('add',{ title:title, content:content, closable:true }); } } $(function(){ $("#closeTab").click(function() { $.post("clear.php",function(data){ window.parent.$('#tt').tabs('close','Create List'); location.reload(); }); }); });
prepare($sql); $stmt->execute(array($_SESSION['username'])); $result= $stmt->fetchAll(); $numRows= $stmt->rowCount(); } catch(PDOException $e) { die ($e->getMessage().' Back'); } if ($numRows == 0) { echo 'You have not created any list yet.';} else { echo 'Your Subscriber List
You have created '.$numRows.' list(s).
'; foreach ($result as $set) { try{ $sql = ' SELECT ls.SubID FROM list_sub ls,user_list ul WHERE ul.UserID=? AND ls.ListID='.$set['ListID'].' AND ls.ListID=ul.ListID '; $stmt = $conn->prepare($sql); $stmt->execute(array($_SESSION['username'])); $numSubs= $stmt->rowCount(); } catch(PDOException $e) { die ($e->getMessage().' Back'); } echo 'List Name : '.$set['ListName'].'
'; echo 'Number of subscriber : '.$numSubs.'
'; echo 'Create Date : '.$set['CreateDate'].'
'; ?>Manage List<? echo ''; }} ?>
prepare($query); $stmt->execute(); $result= $stmt->fetchAll(); $num_rows= $stmt->rowCount(); } catch(PDOException $e) { die ($e->getMessage().' Back'); } $conn = null; if ($num_rows == 0) { echo 'There are no public list.';} else { echo 'Public Subscriber List
There are '.$num_rows.' list(s).
'; foreach ($result as $set) { try{ $sql = ' SELECT ls.SubID FROM list_sub ls,user_list ul WHERE ul.UserID=? AND ls.ListID='.$set['ListID'].' AND ls.ListID=ul.ListID '; $stmt = $conn->prepare($sql); $stmt->execute(array($_SESSION['username'])); $numSubs= $stmt->rowCount(); } catch(PDOException $e) { die ($e->getMessage().' Back'); } echo 'List Name : '.$set['ListName'].'
'; echo 'Number of subscriber : '.$numSubs.'
'; echo 'Create Date : '.$set['CreateDate'].'
'; echo "Manage List"; // **********************the add tag link is here***************************// echo ''; }} ?>