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. D3.js系列——布局:饼状图和力导向图

    一.饼状图 在布局的应用中,最简单的就是饼状图. 1.数据 有如下数据,需要可视化: , , , , ]; 这样的值是不能直接绘图的.例如绘制饼状图的一个部分,需要知道一段弧的起始角度和终止角度,这些 ...

  2. hibernate学习系列-----(6)hibernate对集合属性的操作之Set集合篇

    先说一段废话吧,本打算每天把所学的知识总结为博客的,但是昨天为什么没有写呢?没有学习吗?No,那是为什么?贪玩,对,这位同学说对了,老实说昨天感觉身体不怎么舒服,大家都知道,这其实就是为自己懒找借口, ...

  3. static_cast、dynamic_cast、const_cast和reinterpret_cast总结(转)

    前言 这篇文章总结的是C++中的类型转换,这些小的知识点,有的时候,自己不是很注意,但是在实际开发中确实经常使用的.俗话说的好,不懂自己写的代码的程序员,不是好的程序员:如果一个程序员对于自己写的代码 ...

  4. JavaEE应用程序

    一直想写一些关于JavaEE的东西,从刚開始看<Ejb in Action>的时候就想写,总是感觉自己知道的太少了.太不值得一提了.太欠缺了(我太谦虚了)--哈哈哈.到后来工作中一直在使用 ...

  5. 为每一个应用程序池单独设置aspnet.config配置文件

    ASP.NET2.0之后的版本号就在各Framework的根文件夹下提供了一个aspnet.config文件.这个文件用来配置全局的一些信息,可是一直以来我们都没有怎么用过. ASP.NET4.0之后 ...

  6. hibernate 继承映射关系( SINGLE_TABLE)

    三种继承映射关系.   1,SINGLE_TABLE   person student  teacher 在一个表中,student和teacher继承自person,通过一个Discriminato ...

  7. 10、驱动中的阻塞与非阻塞IO

        阻塞,就是在获取资源的时候,不能获取到,那么就会将当前的进程挂起(睡眠,也就是将当前进程从调度器拿走了,不会调度当前进程),直到满足条件为止再进行操作.相反,非阻塞,就是即使不能获取到资源,非 ...

  8. es模板

    Index Templatesedit Index templates allow you to define templates that will automatically be applied ...

  9. Audio简介

    本片只简单从硬件角度简介Audio AC97/HDA Audio总线分两种: (1)I2S (2)HDA HD Audio spec Audio verb table是用来初始化audio的,一个au ...

  10. php对象序列化总出错false

    php unserialize 返回false的解决方法 php 提供serialize(序列化) 与unserialize(反序列化)方法. 使用serialize序列化后,再使用unseriali ...