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 ...
随机推荐
- linux 下使用genymotion
在官网下载genymotion http://www.genymotion.cn/ 然后进行下面操作 1.假设本机没有virtualbox 下载一个 能够通过指令 sudo apt-get inst ...
- Azure Pack演示样例缩放部署架构
- [DevExpress]DevExpress的安装与使用
一.下载安装文件 依据自己的须要选择不同的版本号.下面为15.1 安装时选择自己须要的模块进行安装,之后进行激活,购买授权或者"其它方式". 二.安装完 在VSIDE工具栏会添加下 ...
- kendo datepicker汉化
kendo grid 支持多语言,包括的语言有非常多种.一般默认情况是使用en,可是对于国内市场的话我们须要使用汉字.不墨迹了. <link href="http://cdn. ...
- go6---slice切片
package main /* 切片Slice 其本身并不是数组,它指向底层的数组 作为变长数组的替代方案,可以关联底层数组的局部或全部 为引用类型 可以直接创建或从底层数组获取生成 使用len()获 ...
- 同一个站点下,兼容不同版本的JQuery
https://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page Y ...
- Analyzing with SonarScanner for MSBuild
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild Features The So ...
- YTU 2508: 武功秘籍
2508: 武功秘籍 时间限制: 1 Sec 内存限制: 128 MB 提交: 1384 解决: 438 题目描述 小明到X山洞探险,捡到一本有破损的武功秘籍(2000多页!当然是伪造的). 他 ...
- Ubuntu14.04 x64 zabbix 3.0 安装
U buntu14.04 x64 zabbix 3.0 安装 苦于网上的文档很多,但是对初学者来说,很多都搭建不成功,我重新安装一下.记录一下. 下载deb wget http://repo.za ...
- 深度学习——无监督,自动编码器——尽管自动编码器与 PCA 很相似,but自动编码器既能表征线性变换,也能表征非线性变换;而 PCA 只能执行线性变换
自动编码器是一种有三层的神经网络:输入层.隐藏层(编码层)和解码层.该网络的目的是重构其输入,使其隐藏层学习到该输入的良好表征. 自动编码器神经网络是一种无监督机器学习算法,其应用了反向传播,可将目标 ...