jQuery MiniUI

标题: datagrid column set readonly [打印本页]

作者: zhq3k    时间: 2014-7-7 16:32:57     标题: datagrid column set readonly

Hi

Datagrid set readonly. cannot allow to edit.

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



作者: felt    时间: 2014-7-7 16:35:09

http://www.miniui.com/demo/#src=datagrid/editable.html
只支持这样的可控编辑功能
作者: zhq3k    时间: 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();
            }
        }
      
    }




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2