zoukankan      html  css  js  c++  java
  • 目前用到最全的datagrid(easyui)


    包含checkbox、复合表头、多行可编辑单元格、combobox单元格,就差上次做的table中每行中的关联检索combobox单元格了。
    目前已修改为单行编辑,多行编辑时的check有问题

    $("#add").click(function(){
     var index=$('#dataGrid').datagrid('appendRow', {         
         FlowTypeName: 'new name',
         FlowTypeCode: 30                
     }).datagrid('getRows').length-1;
     $('#dataGrid').datagrid('beginEdit',index);
    });
    $(function () {
     var datagrid;
     var status = { "statusResult": [
                              { "statusKey": "ALL", "statusVaule":"全部" },
                              { "statusKey": "70", "statusVaule":"已开入WA提单" },
                              { "statusKey": "80", "statusVaule":"已入WA库" }]};
                              console.info(status.statusResult);
       datagrid = $('#dataGrid').datagrid({
            url: "/purchase/findPredictingStockDetailList.html",
            fit: true,
            fitColumns: false,
            toolbar: $('#tb'),
            singleSelect: true,
            nowrap: true,
            rownumbers: true,
            singleSelect: false,
      selectOnCheck: true,
      checkOnSelect: true,
      onClickCell: function(index,field,value){
       $(this).datagrid('beginEdit', index);
       var ed = $(this).datagrid('getEditor', {index:index,field:field});
       $(ed.target).focus();
    //   $(ed).blur(function(){
    //    alert(1111111111111111);
    //    $(this).datagrid('endEdit', index);
    //   });
      },
            queryParams: {
                report_year_week: "$!report_year_week"
            },
            columns: [
                [
                 {field:'check',title:'选择',40,align:'center', rowspan:2,
                     checkbox:true
                 },
                 {field:'aa',title:'启用',60,align:'center', rowspan:2
                 },
                 {title:'判断方式',align:'center',colspan:2},
                 {title:'关闸方式',align:'center',colspan:5},
                 {field:'aaa',title:'说明',300,align:'left', rowspan:2
                 },
             ],[ 
                 {field:'projectID',
                     title:'渠道',
                     100,
                     editor:{
                         type:'combobox',
                         options:{
                             data:status.statusResult,
                    valueField:'statusKey',
                    textField:'statusVaule',
                    panelHeight:'auto',
                             editable:false,
                             onSelect:function(record){
                             } 
                         } 
         }
                 },
                 {field: 'FlowTypeCode', title: '超期库龄', 80, align: 'right',
                     editor: {
                         type: 'text',
                         options: { required: true }
                     }
                 },
                 {field:'col4',title:'渠道',100,rowspan:1},
                 {field:'name1',title:'品牌',100,rowspan:1},
                 {field:'addr1',title:'品类',100,rowspan:1},
                 {field:'col41',title:'型号',100,rowspan:1},
                 {field:'ss',title:'库位',100,rowspan:1}
                ]
            ]
        });
     $('#dataGrid').parent().find("div .datagrid-header-check").children("input[type='checkbox']").eq(0).attr("checked", false);
    });

  • 相关阅读:
    [20160701]DevideByZeroWithoutNoException——from 《Java How To Program (Early Objects), 10th》
    Linux/Centos下安装部署phantomjs 及使用
    SVG中 transform矩阵遇到的兼容性问题
    jQuery中clone和clone(true)的区别
    彻底删除MySQL
    安卓工程师笔试--2015--波导公司
    如何查看、备份电脑隐藏的恢复分区
    效率以及时间维度
    数据集市设计
    Python学习之一:Python2.7与opencv2.4安装配置
  • 原文地址:https://www.cnblogs.com/superJF/p/4398732.html
Copyright © 2011-2022 走看看