easyui如何动态改变列的编辑属性
2024-09-18 07:57:21
动态改变列的编辑属性
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");
}
}
最新文章
- Redis简单案例(三) 连续登陆活动的简单实现
- BMW
- SQL Server中的事务与锁
- 使用BOOTICE 恢复系统启动项
- React-Native hello word 搭建及新手常见问题
- php中opendir函数用法实例
- Android View 之进度条+拖动条+星级评论条....
- php5.3 连接 sqlserver2005
- iLinuxBot: Designing Botnets to Manage Linux Clients
- VB-获取某字符在其中出现的次数
- 【好程序员笔记分享】——UIView与CALayer详解
- scss + react + webpack + es6
- Spring Boot 基础
- asp.net权限认证:OWIN实现OAuth 2.0 之客户端模式(Client Credential)
- c#算两个火星坐标的距离(高德or百度)
- SqlBulkCopy 参数配置示例
- UNIX网络编程——常用服务器模型总结
- PAT1070:Mooncake
- 【ShaderToy】抗锯齿相关函数
- Linux NTP时间同步服务
热门文章
- APUE 习题3-2 实现dup2,要求不使用fcntl函数。
- github入门到上传本地项目
- MySQL高级特性
- LeetCode题解-----Sliding Window Maximum
- struts2中各个jar包作用
- Redis的使用场景 by 杨卫华
- 如何在 Java 中正确使用 wait, notify 和 notifyAll(转)
- [LeetCode] Wildcard Matching 外卡匹配
- 【原】Spark之机器学习(Python版)(二)——分类
- 重度使用示波器进行优化分析——一个DSDA项目回顾