Extend ComboGrid Editors for DataGrid Of JQuery EasyUI
在JQueryEasyUI中为DataGrid自定义了一个ComboGrid编辑器。具体方法:
自己写一个扩展 $.extend($.fn.datagrid.defaults.editors, {
combogrid: {
init: function (container, options) {
var input = $('<input type="text" class="datagrid-editable-input">').appendTo(container);
input.combogrid(options);
return input;
},
destroy: function (target) {
$(target).combogrid('destroy');
},
getValue: function (target) {
return $(target).combogrid('getValue');
},
setValue: function (target, value) {
$(target).combogrid('setValue', value);
},
resize: function (target, width) {
$(target).combogrid('resize', width);
}
}
}); 定义DataGrid <table id="tt1" class="easyui-datagrid" singleselect="true" idfield="MaterialReceivedEntryID"
fit="true" striped="true" rownumbers="true" fitcolumns="true" showfooter="true">
<thead>
<tr>
<th field="ItemID" width="80"
formatter = "itemFormatter"
editor="{
type: 'combogrid', options: {
required: true, panelWidth:260, fitColumns:true,
idField:'ItemID', textField:'Code',
url:'<%= Html.AttributeEncode(Url.Action("GetRMItems", "Item")) %>',
columns:[[
{ field: 'Code', title: '物料代码', width: 80 },
{ field: 'Material', title: '材质', width: 80, align: 'center'},
{ field: 'Diameter', title: '直径', width: 60, align: 'center' }
]],
onSelect:function(rowIndex, rowData) {
$('#tt1').datagrid('updateRow', {
index: _lastIndex, row: {
Material: rowData.Material,
Diameter: rowData.Diameter } })
}
}
}">
原材料代码
</th>
<th field="Material" width="80" align="center">
材质
</th>
<th field="Diameter" width="60" align="center">
直径(mm)
</th>
<th field="Long" width="60" align="center" editor="{ type: 'numberbox', options: { required: true}}">
长度(mm)
</th>
<th field="ReceivedQty" width="60" align="center" editor="{ type: 'numberbox', options: { required: true}}">
根数(PCS)
</th>
<th field="Weight" width="60" align="center" editor="{ type: 'numberbox', options: { required: true, precision: 3}}">
重量(T)
</th>
<th field="HeatNumber" width="100" align="center" editor="{ type: 'validatebox', options: { required: true}}">
炉号
</th>
<th field="Remark" width="80" align="center" editor="text">
备注
</th>
</tr>
</thead>
</table> 最后别忘了那个Formatter function itemFormatter(value, row) { ... ... }
Extend ComboGrid Editors for DataGrid Of JQuery EasyUI的更多相关文章
- jquery easyui datagrid 加载保存好的自定义设置的列属性
直接附上源代码 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <t ...
- jQuery EasyUI之DataGrid使用示例
jQuery EasyUI是一个轻量级的Web前端开发框架,提供了很多的现成组件帮助程序员减轻前端代码开发量,之前有个项目中就用到了其中的DataGrid. jQuery EasyUI框架的官方主页: ...
- Build CRUD Application with jQuery EasyUI
http://www.jeasyui.com/tutorial/app/crud.php It has become a common necessily for web application to ...
- jQuery EasyUI API - Grid - DataGrid [原创汉化官方API]
最近在学习jQuery EasyUI,发现中文的文档好少,部分文档不错但它是鸟语的,为了大家也为了自己学习吧,汉化做一下笔记. 有没有说清楚的,或者翻译不正确的地方还请大家谅解指出.. 由于工作时间原 ...
- 扩展jquery easyui datagrid编辑单元格
扩展jquery easyui datagrid编辑单元格 1.随便聊聊 这段时间由于工作上的业务需求,对jquery easyui比较感兴趣,根据比较浅薄的js知识,对jquery easyui中的 ...
- jQuery EasyUI教程之datagrid应用
一.利用jQuery EasyUI的DataGrid创建CRUD应用 对网页应用程序来说,正确采集和管理数据通常很有必要,DataGrid的CRUD功能允许我们创建页面来列表显示和编辑数据库记录.本教 ...
- 第二百二十二节,jQuery EasyUI,DataGrid(数据表格)组件
jQuery EasyUI,DataGrid(数据表格)组件 学习要点: 1.加载方式 2.分页功能 本节课重点了解 EasyUI 中 DataGrid(数据表格)组件的使用方法,这个组件依赖于 Pa ...
- jQuery EasyUI - 数据表格(DataGrid)
由于工作需要,项目使用前端 jQuery EasyUI - DataGrid 来控制数据表格. 1.加载相关js和css,因为easyui依赖jquery,所有加载easyui前要先加载jquery, ...
- JQuery easyUi datagrid 中 自定义editor作为列表操作按钮列
转自 http://blog.csdn.net/tianlincao/article/details/7494467 前言 JQuery easyUi datagrid 中 使用datagrid生 ...
随机推荐
- 九度OJ 1385 重建二叉树
题目地址:http://ac.jobdu.com/problem.php?pid=1385 题目描述: 输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树.假设输入的前序遍历和中序遍历的结果中都 ...
- 51nod1240莫比乌斯函数
莫比乌斯函数,由德国数学家和天文学家莫比乌斯提出.梅滕斯(Mertens)首先使用μ(n)(miu(n))作为莫比乌斯函数的记号.(据说,高斯(Gauss)比莫比乌斯早三十年就曾考虑过这个函数). ...
- JavaScript中的运算符种类及其规则介绍
JavaScript中的运算符有很多,主要分为算术运算符,等同全同运算符,比较运算符,字符串运算符,逻辑运算符,赋值运算符等.这些运算符都有一些属于自己的运算规则,下面就为大家介绍一下JavaScri ...
- 认识基本的UI资源
什么是UI精灵(Sprite) 在制作UI时,经常将一些零碎的小的UI资源(比如,一个小箭头,一个按钮等)打包成一张大图,然后在使用时,只使用这个大图中的一部分,那么这一块"被切出来&quo ...
- Get your Windows product key from a script
The product key is located in the registry under HKLM\Software\Microsoft\Windows NT\CurrentVersion I ...
- IOS 获得通讯录中联系人的所有属性 备用参考
ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef results = ABAddressBookCopyArrayOfA ...
- noj [1479] How many (01背包||DP||DFS)
http://ac.nbutoj.com/Problem/view.xhtml?id=1479 [1479] How many 时间限制: 1000 ms 内存限制: 65535 K 问题描述 The ...
- Automotive Security的一些资料和心得(2):Cryptography
1. Security Goal - Confidentiality - Integrity - Availability - Authenticity - Non-repudiation - Aut ...
- 一个C语言宏展开问题
转自一个C语言宏展开问题 一个令人比较迷惑的问题,学C语言好多年,今天终于搞明白,记之. ------------------------------------------------------- ...
- asp.net(c#)有关 Session 操作的几个误区
1. this.Session["username"] = null HttpSessionState 内部使 用 NameObjectCollection 类型的集合对象来存储 ...