zoukankan      html  css  js  c++  java
  • dojo dgrid 的列显示html控件


    var columns = [
    {
    field: "first",
    label: "First Name",
    formatter:function(data,object){
    console.log(data);
    console.log(object);
    return "<input type='button' value='test'></input>";
    }

    },
    {
    field: "last",
    label: "Last Name"
    },
    {
    field: "age",
    label: "Age"
    }
    ];

    var grid = new CustomGrid({
    columns:columns,
    selectionMode: "single",
    indirectSeletion:true,// for Selection; only select a single row at a time
    cellNavigation: false // for Keyboard; allow only row-level keyboard navigation
    }, "cartgrid");

    或者

    renderCell:function (object, data, cell) {
    console.log("渲染");
    var o = document.createElement("input"); //使用DOM的创建元素方法
    o.type = "check" ; //设置元素的类型
    o.value = "按钮" ; //设置元素的值
    // document.body.appendChild(o);
    return o;
    }

  • 相关阅读:
    盒子模型中问题
    outline
    高度自动相等方法
    正则表达式
    绝对定位 相对定位
    replace 使用函数作为第二参数
    float 浮动
    line-height 行高
    元素隐藏
    现代浏览器内部
  • 原文地址:https://www.cnblogs.com/dubaokun/p/3221330.html
Copyright © 2011-2022 走看看