动态改变列的编辑属性

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-; $('#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");
}
}

最新文章

  1. Redis简单案例(三) 连续登陆活动的简单实现
  2. BMW
  3. SQL Server中的事务与锁
  4. 使用BOOTICE 恢复系统启动项
  5. React-Native hello word 搭建及新手常见问题
  6. php中opendir函数用法实例
  7. Android View 之进度条+拖动条+星级评论条....
  8. php5.3 连接 sqlserver2005
  9. iLinuxBot: Designing Botnets to Manage Linux Clients
  10. VB-获取某字符在其中出现的次数
  11. 【好程序员笔记分享】——UIView与CALayer详解
  12. scss + react + webpack + es6
  13. Spring Boot 基础
  14. asp.net权限认证:OWIN实现OAuth 2.0 之客户端模式(Client Credential)
  15. c#算两个火星坐标的距离(高德or百度)
  16. SqlBulkCopy 参数配置示例
  17. UNIX网络编程——常用服务器模型总结
  18. PAT1070:Mooncake
  19. 【ShaderToy】抗锯齿相关函数
  20. Linux NTP时间同步服务

热门文章

  1. APUE 习题3-2 实现dup2,要求不使用fcntl函数。
  2. github入门到上传本地项目
  3. MySQL高级特性
  4. LeetCode题解-----Sliding Window Maximum
  5. struts2中各个jar包作用
  6. Redis的使用场景 by 杨卫华
  7. 如何在 Java 中正确使用 wait, notify 和 notifyAll(转)
  8. [LeetCode] Wildcard Matching 外卡匹配
  9. 【原】Spark之机器学习(Python版)(二)——分类
  10. 重度使用示波器进行优化分析——一个DSDA项目回顾