treetable adding nodes at root level
| describe("loadBranch()", function() { | ||
| beforeEach(function() { | ||
| this.newRows = "<tr data-tt-id='3' data-tt-parent-id='2'><td>N3</td></tr><tr data-tt-id='4' data-tt-parent-id='2'><td>N4</td></tr>" | ||
| - this.moreRows = "<tr data-tt-id='5' data-tt-parent-id='2'><td>N5</td></tr>" | ||
| + this.moreRows = "<tr data-tt-id='5' data-tt-parent-id='2'><td>N5</td></tr>"; | ||
| this.subject.treetable(); | ||
| this.parentNode = this.subject.treetable("node", 2); | ||
| @@ -276,9 +276,32 @@ | ||
| expect(this.subject.data("treetable").tree[4]).to.be.defined; | ||
| }); | ||
| + it("registers nodes", function() { | ||
| + expect(this.subject.data("treetable").nodes.length).to.equal(3); | ||
| + this.subject.treetable("loadBranch", this.parentNode, this.newRows); | ||
| + expect(this.subject.data("treetable").nodes.length).to.equal(5); | ||
| + }); | ||
| + | ||
| it("maintains chainability", function() { | ||
| expect(this.subject.treetable("loadBranch", this.parentNode, this.newRows)).to.equal(this.subject); | ||
| }); | ||
| + | ||
| + describe("adding nodes at root level", function() { | ||
| + beforeEach(function() { | ||
| + this.rootRows = "<tr data-tt-id='6'><td>N6</td></tr>"; | ||
| + }); | ||
| + | ||
| + it("registers nodes as root nodes", function () { | ||
| + expect(this.subject.data("treetable").roots.length).to.equal(1); | ||
| + this.subject.treetable("loadBranch", null, this.rootRows); | ||
| + expect(this.subject.data("treetable").roots.length).to.equal(2); | ||
| + }); | ||
| + | ||
| + it("inserts rows into DOM", function () { | ||
| + this.subject.treetable("loadBranch", null, this.rootRows); | ||
| + expect($(this.subject[0].rows[3]).data("ttId")).to.equal(6); | ||
| + }); | ||
| + }); | ||
| }); | ||
treetable adding nodes at root level的更多相关文章
- logback root level logger level 日志级别覆盖?继承?
1. logback-spring.xml 配置 <appender name="STDOUT" class="ch.qos.logback.core.Consol ...
- Leetcode之深度优先搜索(DFS)专题-1080. 根到叶路径上的不足节点(Insufficient Nodes in Root to Leaf Paths)
Leetcode之深度优先搜索(DFS)专题-1080. 根到叶路径上的不足节点(Insufficient Nodes in Root to Leaf Paths) 这篇是DFS专题的第一篇,所以我会 ...
- C# UTF8的BOM导致XML序列化与反序列化报错:Data at the root level is invalid. Line 1, position 1.
最近在写一个xml序列化及反序列化实现时碰到个问题,大致类似下面的代码: class Program { static void Main1(string[] args) { var test = n ...
- 【leetcode】1080. Insufficient Nodes in Root to Leaf Paths
题目如下: Given the root of a binary tree, consider all root to leaf paths: paths from the root to any l ...
- Data Structure Binary Tree: Connect nodes at same level using constant extra space
http://www.geeksforgeeks.org/connect-nodes-at-same-level-with-o1-extra-space/ recursive: #include &l ...
- C# LoadXml System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
去掉BOM头 writer = new XmlTextWriter(stream, new UnicodeEncoding(false,false)); 如果是UTF8 writer = new Xm ...
- LintCode Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...
- [LeetCode]题解(python):107 Binary Tree Level Order Traversal II
题目来源 https://leetcode.com/problems/binary-tree-level-order-traversal-ii/ Given a binary tree, return ...
- [LeetCode]题解(python):103 Binary Tree Zigzag Level Order Traversal
题目来源 https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ Given a binary tree, re ...
随机推荐
- C#如何让Listbox支持多选
把SelectionMode改成MultiExtended
- [Qt总结篇]终端远程升级client
环境: QT4.8.5 for Windows(Qt Creator+MinGW) 一.写在前面: 1.深度:鉴于C/C++的功底还远远不足,个人主要精力还是学习C/C++,所以没打算继续深入研究Qt ...
- MFC中按下Buttonbutton,弹出一个窗体的同一时候关闭本窗体
CMyDlg *dlg = new CMyDlg(); //新建一个CMyDlg对象 this->ShowWindow(SW_HIDE); ...
- iOS开发——常见BUG——导航控制器中的子控制器设置StatusBar状态失效的问题
iOS9之前控制StatusBar的两种方式: 第一种方式:全局控制StatusBar 1. 在项目的Info.plist文件里设置UIViewControllerBasedStatusBarAppe ...
- gitlab结构分析
1 gitlab的工作流程 2
- lucene .doc文件格式解析——见图
摘自:http://forfuture1978.iteye.com/blog/546841 4.2.2. 文档号及词频(frq)信息 文档号及词频文件里面保存的是倒排表,是以跳跃表形式存在的. 此文件 ...
- [LeetCode] LRU Cache [Forward]
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the fol ...
- BZOJ_1229_[USACO2008 Nov]toy 玩具_三分+贪心
BZOJ_1229_[USACO2008 Nov]toy 玩具_三分+贪心 Description 玩具 [Chen Hu, 2006] Bessie的生日快到了, 她希望用D (1 <= D ...
- EasyUI Calendar 日历
转自:http://www.jeasyui.net/plugins/175.html 通过 $.fn.calendar.defaults 重写默认的 defaults. 日历(calendar)显示允 ...
- System.out.println()的含义
system是java.lang包中定义的一个内置类,在该类中定义了一个静态对象out out是PrintStream类的实例对象 println是PrintStream类中的方法