atitit.表格的綁定client side 最佳實務

來源:互聯網
上載者:User

標籤:style   blog   http   io   ar   for   資料   sp   cti   

atitit.表格的綁定client side 最佳實務 

 

1. 架構選型 1

2. #---原理和流程 1

1. 方法1 1

2. Dwr 例子 1

3. 方法2 2

4. Jq例如 2

 

1. 架構選型

Easyui 好..走十難調整???

 

嘎自的表格只好js jvc 蘭,,,angular

 

Dwr也能了...

 

 

2. #---原理和流程

 

1. 方法1

獲得所有的行,第一的頭行except,第二模板line,..排除,,,在的所有的資料行刪除.

遍曆表格模板tr獲得tds的所有的id(yash  obj.propty)數組.

作者:: 老哇的爪子 Attilax 艾龍,  EMAIL:[email protected]

轉載請註明來源: http://blog.csdn.net/attilax

 

2. Dwr 例子

Foreach dataList:::z[

  dwr.util.cloneNode;/// note id propty yao del...coloneRow

   Foreach headList>>  經過column index,get propty name,   thend tds[idx]=obj.propty

End for

Add coloneRow2table..

//or }

 

3. 方法2

根據id/id索引來獲得繫結資料源裡面的資料欄位..綁定到個td上..

 

4. Jq例如

function fillTable() {

  People.getSmallCrowd(function(people) {

    // Delete all the rows except for the "pattern" row

    dwr.util.removeAllRows("peoplebody", { filter:function(tr) {

      return (tr.id != "pattern");

    }});

    // Create a new set cloned from the pattern row

    var person, id;

    people.sort(function(p1, p2) { return p1.name.localeCompare(p2.name); });

    for (var i = 0; i < people.length; i++) {

      person = people[i];

      id = person.id;

      dwr.util.cloneNode("pattern", { idSuffix:id });

      dwr.util.setValue("tableName" + id, person.name);

      dwr.util.setValue("tableAge" + id, person.age);

      dwr.util.setValue("tableAddress" + id, person.address);

      dwr.util.setValue("tableSuperhero" + id, person.superhero ? "Yes" : "No");

      dwr.util.byId("pattern" + id).style.display = ""; // officially we should use table-row, but IE prefers "" for some reason

      peopleCache[id] = person;

    }

  });

}

 

atitit.表格的綁定client side 最佳實務

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.