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. [Typescript] Improve Readability with TypeScript Numeric Separators when working with Large Numbers

    When looking at large numbers in code (such as 1800000) it’s oftentimes difficult for the human eye ...

  2. Mac电脑下配置maven环境变量

    Mac电脑下配置maven环境变量 打开终端,使用 touch 命令创建 .bash_profile 文件 touch .bash_profile 编辑刚刚创建的文件 .bash_profile vi ...

  3. JavaScript操作dom总结

    最近一直忙于新项目,真的挺费心的 从产品原型.ui.接口.真心挺费心的.好多地方都不完善!(i want say F word!!) 基础的东西又需要重新看看了! Node Node.NodeType ...

  4. iOS学习笔记之蓝牙(有关蓝牙设备mac地址处理) 2

    1.创建中心设备,并设置代理 一般情况下,手机是中心设备,蓝牙设备是外围设备. self.centralManager = [[CBCentralManager alloc] initWithDele ...

  5. eclipse中egit插件使用(转)

    1.eclipse和egit版本 eclipse使用的是kepler的SR1版,egit就是自带的那个版本,要详细的话,我就也只能把文件名贴出来了:eclipse-jee-kepler-SR1-win ...

  6. JAVA 的IO操作实例

    实例要求: 1,加法操作: 键盘输入两个数字,完成加法操作.因为从键盘接收过来的内容都是通过字符串形式存放的,所以此时直接通过包装类 Integer将字符串变为基本数据类型. 2,菜单显示: 采用的知 ...

  7. sqlserver用户角色相关的权限

  8. 【设计模式 7】从公司的目前框架和API Gateway,谈谈对外观模式的理解

    我,第一次用到外观模式,应该是3年多以前.那时候是做一个收费系统,在当时的U层和B层之间,加了一层Facade.当时,在一些复杂的业务逻辑处理时,感受到了加入外观层的好处,但对于一些简单的(我指的是, ...

  9. Effective C++ 条款47

    本节条款的题目:请使用trait classes来表示类型信息 本节条款主要讲述的技术是怎样在编译期间实现对迭代器类型的推断,依据推断的类型进行最优处理. 我们先来看一下迭代器的种类: 1.input ...

  10. CCS调试教程

    包括CCS3.3和CCS5.5两个版本的调试教程. CCS3.3 3.3教程来自http://zhujlhome.blog.163.com/blog/static/205621092201261032 ...