• easyui如何动态改变列的编辑属性


    动态改变列的编辑属性

    var tt=$('#dg').datagrid('getColumnOption', 'yearContent'); //通过列名获得此列
                        tt.editor={type:'textarea'}; //设置此列的编辑属性 如果禁用编辑 则设置 tt.editor={}

     新增一行时 yearContent 列可以编辑

        function append(){
                
                    if (endEditing()){                    
                        $('#dg').datagrid('appendRow',{});//新增一行
                        var tt=$('#dg').datagrid('getColumnOption', 'yearContent');
                        tt.editor={type:'textarea'};
                        editIndex = $('#dg').datagrid('getRows').length-1;
                        
                        $('#dg').datagrid('selectRow', editIndex)
                                .datagrid('beginEdit', editIndex);
                        
                        $("textarea").css("height","85px");                    
                    }            
            }

    点击一行时 yearContent 列不可以编辑

     function onClickRow(index,field,value){
                 
                if (editIndex != index){
                    if (endEditing()){    
                        var tt=$('#dg').datagrid('getColumnOption', 'yearContent');
                        tt.editor={};
                        $('#dg').datagrid('selectRow', index)
                                .datagrid('beginEdit', index);
                        editIndex = index;
                    } else {
                        $('#dg').datagrid('selectRow', editIndex);
                    }
                    $("textarea").css("height","85px");
                }
            }
  • 相关阅读:
    vuejs学习小结(数据处理)
    vuejs的遇到的问题小结
    ES6 对象扩展
    webpack的两个难点
    Sass入门:第二章
    Sass入门:第一章
    Effective JavaScript :第六章
    Effective JavaScript :第五章
    Effective JavaScript :第四章
    Effective JavaScript :第三章
  • 原文地址:https://www.cnblogs.com/heyesp/p/5826963.html
Copyright © 2020-2023  润新知