zoukankan      html  css  js  c++  java
  • 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);
        + });
        + });
        });
         
  • 相关阅读:
    17、网卡驱动程序-DM9000举例
    16、NOR FLASH驱动框架
    15.1 linux操作系统下nand flash驱动框架2
    15、NAND FLASH驱动程序框架
    14、块设备驱动程序框架分析
    12.2 linux USB框架分析(详细注册match匹配过程)
    arm-linux-gcc: Command not found
    12、USB设备驱动程序
    POJ-2752 Seek the Name, Seek the Fame (KMP)
    POJ-2406 Power Strings (KMP)
  • 原文地址:https://www.cnblogs.com/telwanggs/p/7434521.html
Copyright © 2011-2022 走看看