zoukankan      html  css  js  c++  java
  • atitit.表格的绑定client side 最佳实践

    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:1466519819@qq.com

    转载请注明来源: 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;

        }

      });

    }

    我要啦免费统计
  • 相关阅读:
    dedecms自定义表单提交获取时间跟ip地址
    JQuery购物车多物品数量的加减+总价计算
    jquery手机触屏滑动拼音字母城市选择器代码
    js实现图片上传实时显示
    js实现发送验证码倒计时效果
    JS 仿支付宝input文本输入框放大组件
    js实现倒计时效果
    jquery统计输入文字的个数并对其进行判断
    【Linux】Linux系统安全设置
    java泛型(generics)
  • 原文地址:https://www.cnblogs.com/attilax/p/15199115.html
Copyright © 2011-2022 走看看