Ext.define('Task', {
extend: 'Ext.data.Model',
idProperty: 'taskId',
fields: [
{ name: 'projectId', type: 'string' },
{ name: 'project', type: 'string' },
{ name: 'taskId', type: 'string' },
{ name: 'description', type: 'string' },
{ name: 'estimate', type: 'string' },
{ name: 'rate', type: 'string' },
{ name: 'cost', type: 'string' },
{ name: 'due', type: 'string' }
]
}); var data = [
{ projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 112, description: 'Integrate 2.0 Forms with 2.0 Layouts', estimate: 6, rate: 150, due: '06/24/2007' },
{ projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 113, description: 'Implement AnchorLayout', estimate: 4, rate: 150, due: '06/25/2007' },
{ projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 115, description: 'Testing and debugging', estimate: 8, rate: 0, due: '06/29/2007' },
{ projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 101, description: 'Add required rendering "hooks" to GridView', estimate: 6, rate: 100, due: '07/01/2007' },
{ projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 103, description: 'Extend Store with grouping functionality', estimate: 4, rate: 100, due: '07/04/2007' },
{ projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 121, description: 'Default CSS Styling', estimate: 2, rate: 100, due: '07/05/2007' },
{ projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 108, description: 'Remote summary integration', estimate: 4, rate: 125, due: '07/05/2007' },
{ projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 110, description: 'Integrate summaries with GroupingView', estimate: 10, rate: 125, due: '07/11/2007' },
{ projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 111, description: 'Testing and debugging', estimate: 8, rate: 125, due: '07/15/2007' }
]; Ext.onReady(function () { Ext.tip.QuickTipManager.init(); var store = Ext.create('Ext.data.Store', {
model: 'Task',
data: data,
groupField: 'project'
}); var cellEditing123 = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 2,//行内编辑 双击
clicksToMoveEditor: 1,//点击编辑按钮编辑
autoCancel: false
});
var showSummary = true;
var grid = Ext.create('Ext.grid.Panel', {
width: 900,
height: 450,
frame: true,
title: 'Sponsored Projects',
iconCls: 'icon-grid',
renderTo: document.body,
store: store,
plugins: [cellEditing123],
//dockedItems: [{
// dock: 'top',
// xtype: 'toolbar',
// items: [{
// tooltip: 'Toggle the visibility of the summary row',
// text: 'Toggle Summary',
// enableToggle: true,
// pressed: true,
// handler: function () {
// var view = grid.getView();
// showSummary = !showSummary;
// view.getFeature('group').toggleSummaryRow(showSummary);
// view.refresh();
// }
// }]
//}],
features: [{
id: 'group',
ftype: 'groupingsummary',
groupHeaderTpl: '{name}',
hideGroupedHeader: true,
enableGroupingMenu: false
}],
columns: [ {
header: 'Due Date',
width: 280,
sortable: false,
dataIndex: 'due',
menuDisabled: true,
editor: {
allowBlank: true
}
}, {
header: 'Project',
width: 180,
sortable: false,
menuDisabled: true,
dataIndex: 'project'
}, {
header: 'Estimate',
width: 275,
sortable: false,
dataIndex: 'estimate',
menuDisabled: true,
editor: {
allowBlank: true
}
},
{
xtype: 'actioncolumn',
width: 30,
sortable: false,
menuDisabled: true,
items: [{
icon: '../../../lib/Ext/img/edit.gif',
tooltip: '编辑',
scope: this,
handler: function (grid, rowIndex) {
cellEditing123.cancelEdit();
cellEditing123.startEdit(rowIndex, 0);
}
}]
},
{
xtype: 'actioncolumn',
width: 30,
sortable: false,
menuDisabled: true,
items: [{
icon: '../../../lib/Ext/img/delete.gif',
tooltip: '删除',
scope: this,
handler: function (grid, rowIndex) {
Ext.MessageBox.confirm('Confirm', '确定删除该记录?', function (btn) {
if (btn != 'yes') {
return;
}
var SelectionModel = grid.getSelectionModel();
SelectionModel.select(rowIndex);
var store = grid.getStore();
store.remove(SelectionModel.getSelection());
})
}
}]
}]
});
});

效果:

gridgroup行内编辑删除的更多相关文章

  1. 第一节:EasyUI样式,行内编辑,基础知识

    一丶常用属性 $('#j_dg_left').datagrid({ url: '/Stu_Areas/Stu/GradeList', fit: true, // 自动适应父容器大小 singleSel ...

  2. bootstrap editable 行内编辑

    除了那些bootstrap/bootstrap table的js , css之外,要额外添加editable的文件: <link href="../assets/css/bootstr ...

  3. Django项目:CRM(客户关系管理系统)--69--59PerfectCRM实现king_admin行内编辑

    #base_admin.py # ————————24PerfectCRM实现King_admin自定义操作数据———————— from django.shortcuts import render ...

  4. ASP.NET Aries 入门开发教程6:列表数据表格的格式化处理及行内编辑

    前言: 为了赶进度,周末也写文了! 前几篇讲完查询框和工具栏,这节讲表格数据相关的操作. 先看一下列表: 接下来我们有很多事情可以做. 1:格式化 - 键值的翻译 对于“启用”列,已经配置了格式化 # ...

  5. JS组件系列——BootstrapTable 行内编辑解决方案:x-editable

    前言:之前介绍bootstrapTable组件的时候有提到它的行内编辑功能,只不过为了展示功能,将此一笔带过了,罪过罪过!最近项目里面还是打算将行内编辑用起来,于是再次研究了下x-editable组件 ...

  6. jQuery EasyUI 数据网格 - 启用行内编辑(转自http://www.runoob.com/jeasyui/jeasyui-datagrid-datagrid12.html)

    可编辑的功能是最近添加到数据网格(datagrid)的.它可以使用户添加一个新行到数据网格(datagrid).用户也可以更新一个或多个行.本教程向您展示如何创建一个数据网格(datagrid)和内联 ...

  7. ASP.NET MVC5+EF6+EasyUI 后台管理系统(83)-Easyui Datagrid 行内编辑扩展

    这次我们要从复杂的交互入手来说明一些用法,这才能让系统做出更加复杂的业务,上一节讲述了Datagird的批量编辑和提交本节主要演示扩展Datagrid行内编辑的属性,下面来看一个例子,我开启编辑行的时 ...

  8. Dynamics 365新功能:可编辑的网格(行内编辑)

    关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复238或者20161127可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong. ...

  9. bootstrap-editable实现bootstrap-table行内编辑

    bootstrap-editable行内编辑效果如下: 需要引入插件 列初始化代码,为可编辑的列添加editable属性: columns = [ { title: '文件名', field: 'Na ...

随机推荐

  1. http://blog.sina.com.cn/s/blog_628cc2b70102v115.html

    http://blog.sina.com.cn/s/blog_628cc2b70102v115.html

  2. 倍福TwinCAT(贝福Beckhoff)常见问题(FAQ)-点击运行按钮进入到运行状态报错Error starting TwinCAT System怎么办 AdsWarning1823怎么办

    一般提示如下   点击Device,然后选中当前真正连接到的网卡   一般是由于重装系统之后,没有把本来是realtime capable的设备Install,所以找不到支持EtherCAT的设备导致 ...

  3. tomcat优化---大数据量提交tomcat时,tomcat无法接收导致页面无反应

    关于tomcat的一个优化问题: 有时候保存大数据量的数据时.tomcat不优化的话,页面会没反应.tomcat后台并不报错,仅仅是提示以下内容: 警告: More than the maximum  ...

  4. jQuery编程小结

    加载jQuery 1.坚持使用CDN来加载jQuery,这种别人服务器免费帮你托管文件的便宜干嘛不占呢.点击查看使用CDN的好处,点此查看一些主流的jQuery CDN地址. <script t ...

  5. unity Chan!下载

    http://unity-chan.com/download/datadownload.html

  6. sql中limit和汇总函数的集合使用

    limit和求和一起 select SUM(A.high) from (select * from minute1_K order by DateTime desc limit 10) A limit ...

  7. 使用jconsole监控tomcat(推荐配置)

    1.在tomcat启动过程中,开启相应的参数配置 $Tomcat_home/bin/catalina.sh: 1 2 3 4 -Dcom.sun.management.jmxremote -Dcom. ...

  8. XYWi-Fi v2.0 简单的笔记本无线热点分享工具【Win】

    [软件名称]XYWi-Fi [版本号]v2.0 [适用系统]Windows 7/8/8.1/10 [功能特性]简单的笔记本无线热点分享工具 [下载地址]pan.baidu.com/s/1mgmOpJi ...

  9. 檢查php文件中是否含有bom的php文件

    原文链接: http://www.cnblogs.com/Athrun/archive/2010/05/27/1745464.html 另一篇文章:<关于bom.php>,http://h ...

  10. C# 6.0语法糖剖析

    C# 6.0语法糖剖析 2016年12月16日 16:10:27 阅读数:586   版权声明:本文为博主http://www.feixueteam.net原创文章,未经博主允许不得转载. https ...