datagrid editor动态的改变不同行修改列的editor属性

 onBeforeEdit: function (row) {
                let options = $(this).treegrid('options');
                options.tempeditor = options.tempeditor || {};
                let getColumnOption = $(this).treegrid('getColumnOption', 'sampleTypeId');
                if (!options.tempeditor["sampleTypeId"]) {
                    options.tempeditor["sampleTypeId"] = getColumnOption.editor;
                }
                if (row.parentId) {
                    getColumnOption.editor = undefined;
                } else {
                    getColumnOption.editor = options.tempeditor["sampleTypeId"];
                }

            }

 

posted @ 2018-11-06 10:27  米姐  阅读(958)  评论(0编辑  收藏  举报