easyui 功能介绍

最近使用easyui,

下面,我介绍下常用功能:



//绑定Product总类型
        $('#gdv_ProductParentType').datagrid({
            url: '../api/BindData/GetProductParentType',
            method: 'get', //默认是post,不允许对静态文件访问
            width: '700',
            rownumbers: true,
            columns: [[
                //绑定操作列
                {field:'opt',title:'操作',width:100,align:'center',    
                formatter: function (value, rec, index) {
                    //通过传入PT_ID
                        var s = '<a href="#" title="View" mce_href="#" onclick="view(\'' + rec.PT_ID + '\')"><img class="viewButton"/></a> ';
                        var e = '<a href="#" title="Edit" mce_href="#" onclick="edit(\'' + rec.PT_ID + '\')"><img class="editButton"/></a> ';
                        var d = '<a href="#" title="Delete" mce_href="#" onclick="del(\'' + rec.PT_ID + '\')"><img class="delButton"/></a> ';
                        return s + "    " + e + "    " + d;
                    }
                },
                 //这一列被隐藏了 hidden:true
                { field: 'PT_ID', title: 'PT_ID' ,hidden:true},
                { field: 'PT_Name', title: 'PT_Name' },
                { field: 'PT_CreateTime', title: 'PT_CreateTime',
                    //设定时间显示格式
                    formatter: function (value, row, index) {
                        var dt = new Date(value);
                        return dt.toLocaleDateString();
                    }
                }
            ]],
            //单击事件
            onClickRow: function (index, row) {
                BindProductChildType(1);
            },
            //工具栏
            toolbar:[{    
                text:'Add',iconCls:'icon-add',handler:function(){    
                    window.location.href='StuAdd.aspx';    
                }    
            }],
            singleSelect: false, //允许选择多行
            selectOnCheck: true,//true勾选会选择行,false勾选不选择行, 1.3以后有此选项
            checkOnSelect: true //true选择行勾选,false选择行不勾选, 1.3以后有此选项
        });




转载于:https://www.cnblogs.com/hanjun0612/p/9779892.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值