jQuery MiniUI

 找回密码
 立即注册
查看: 2528|回复: 2
打印 上一主题 下一主题

datagrid column set readonly [复制链接]

Rank: 3Rank: 3

跳转到指定楼层
楼主
发表于 2014-7-7 16:32:57 |只看该作者 |倒序浏览
Hi

Datagrid set readonly. cannot allow to edit.

but the column will can edit when put the tab key move to the readonly column.


Rank: 8Rank: 8

沙发
发表于 2014-7-7 16:35:09 |只看该作者
http://www.miniui.com/demo/#src=datagrid/editable.html
只支持这样的可控编辑功能

Rank: 3Rank: 3

板凳
发表于 2014-7-22 12:42:24 |只看该作者
onDetailGridCellBeginEdit: function (e) {
        if (e.editor == null || e.column.readOnly == true) {
            if (window.event.keyCode == 9) {
                var firsColumnIndex = this.getFirstEditColumnIndex(e.sender);
                var columns = e.sender.getColumns();
                var currentColumnIndex = columns.indexOf(e.column);
                var nextColumnIndex = 0;
                var nextRowIndex = 0;
                if (currentColumnIndex == (columns.length - 1)) {
                    nextColumnIndex = firsColumnIndex;
                    if (e.rowIndex == (e.sender.getTotalCount() - 1)) {
                        nextRowIndex = e.rowIndex;
                    } else {
                        nextRowIndex = e.rowIndex + 1;
                    }
                } else {
                    nextColumnIndex = currentColumnIndex + 1;
                    nextRowIndex = e.rowIndex;
                }
                e.cancel = true;
                e.sender.setCurrentCell([nextRowIndex, nextColumnIndex]);
                e.sender.beginEditCell();
            }
        }
      
    }

Archiver|普加软件

GMT+8, 2024-9-30 13:30 , Processed in 1.064052 second(s), 10 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部