slickgrid中editor的使用

slickGridHeadColumns = [//表头
                        {"display": true, "field": "taskName", "id": 110102, "name": "任务名称", "width": 300, "editor": Slick.Editors.Text},
                        {"display": true, "field": "status", "id": 110103, "name": "状态", "width": 80},
                        {"display": true, "field": "siteCode", "id": 110104, "name": "站点", "width": 80},
                        {"display": true, "field": "ebayAccountName", "id": 110105, "name": "EBAY账户", "width": 180},
                        {"display": true, "field": "createdDate", "id": 110106, "name": "创建时间", "width": 180},
                        {"display": true, "field": "successCount", "id": 110107, "name": "成功数量", "width": 180},
                        {"display": true, "field": "faildCount", "id": 110108, "name": "失败数量", "width": 180},
                        {"display": true, "field": "operationId", "id": 110109, "name": "操作", "width": 200}
                    ],

gridOptions = {//表格大小参数
                        editable: true,
                        asyncEditorLoading: false,
                        autoEdit: false,

                        enableAddRow: false,
                        enableCellNavigation: true,
                        rowHeight: 30
                    };

var item = {};

//可编辑事件失焦前触发的函数
grid.onBeforeEditCell.subscribe(function (e, args) {
      item = objThis.slickGridView.getItem(args.row);
});
//可编辑事件失焦后触发的函数
grid.onBeforeCellEditorDestroy.subscribe(function (e, args) {
      console.log(item);//这里的args与onBeforeEditCell 中的不同,失去焦点之后会把当前行的对象丢失
      item = {};
});


转载于:https://my.oschina.net/AllenWang5/blog/467437

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值