Ext.onReady(function(){
Ext.QuickTips.init();
function formatDate(value){
return value ? value.dateFormat('M d, Y') : '';
};
// shorthand alias
var fm = Ext.form;
// custom column plugin example
var checkScanRight = new Ext.grid.CheckColumn({
header: "浏览权限?",
dataIndex: 'ScanRight',
width: 60
});
var checkInsert = new Ext.grid.CheckColumn({
header: "添加权限?",
dataIndex: 'InsertRight',
width: 60
});
var checkDeleeRight = new Ext.grid.CheckColumn({
header: "删除权限?",
dataIndex: 'DeleeRight',
width: 60
});
var checkUpdaeRight = new Ext.grid.CheckColumn({
header: "修改权限?",
id:'UpdaeRight',
dataIndex: 'UpdaeRight',
width: 60
});
// the column model has information about grid columns
// dataIndex maps the column to the specific data field in
// the data store (created below)
var cm = new Ext.grid.ColumnModel([{
id:'common',
header: "Common Name",
dataIndex: 'common',
width: 240,
editor: new fm.TextField({
allowBlank: false
})
},{
header: "Light",
dataIndex: 'light',
width: 130,
editor: new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'light',
lazyRender:true,
listClass: 'x-combo-list-small'
})
},{
header: "Price",
dataIndex: 'price',
width: 70,
align: 'right',
renderer: 'usMoney',
editor: new fm.NumberField({
allowBlank: false,
allowNegative: false,
maxValue: 100000
})
},{
header: "Available",
dataIndex: 'availDate',
width: 95,
renderer: formatDate,
editor: new fm.DateField({
format: 'm/d/y',
minValue: '01/01/06',
disabledDays: [0, 6],
disabledDaysText: 'Plants are not available on the weekends'
})
},
checkScanRight,
checkInsert,
checkDeleeRight,
checkUpdaeRight
]);
// by default columns are sortable
cm.defaultSortable = true;
// this could be inline, but we want to define the Plant record
// type so we can add records dynamically
var Plant = Ext.data.Record.create([
// the "name" below matches the tag name to read, except "availDate"
// which is mapped to the tag "availability"
{name: 'common', type: 'string'},
{name: 'botanical', type: 'string'},
{name: 'light'},
{name: 'price', type: 'float'}, // automatic date conversions
{name: 'availDate', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y'},
{name: 'ScanRight', type: 'bool'},
{name: 'InsertRight', type: 'bool'},
{name: 'DeleeRight', type: 'bool'},
{name: 'UpdaeRight', type: 'bool'}
]);
// create the Data Store
var store = new Ext.data.Store({
// load using HTTP
url: 'jsp-plants.jsp',
// the return will be XML, so lets set up a reader
reader: new Ext.data.XmlReader({
// records will have a "plant" tag
record: 'plant'
}, Plant),
sortInfo:{field:'common', direction:'ASC'}
});
// create the editor grid
var grid = new Ext.grid.EditorGridPanel({
store: store,
cm: cm,
renderTo: 'editor-grid',
width:650,//宽度
height:350,//高度
autoExpandColumn:'common',
title:'Edit Plants?',
frame:true,
plugins:[checkInsert,checkScanRight,checkDeleeRight,checkUpdaeRight],
clicksToEdit:1,
tbar: [{
text: 'Add Plant',
handler : function(){
var p = new Plant({
common: 'New Plant 1',
light: 'Mostly Shade',
price: 0,
availDate: (new Date()).clearTime(),
ScanRight: false,
InsertRight:false,
DeleeRight:false,
UpdaeRight:false
});
grid.stopEditing();
store.insert(0, p);
grid.startEditing(0, 0);
}
}]
});
// trigger the data store load
store.load();
var top = new Ext.FormPanel({
buttonAlign:'right',
labelWidth:70,
frame:true,
title: '职员管理',
bodyStyle:'padding:5px 5px 0',
style:'margin:10px',
items: [{
xtype:'fieldset',
title: '基本信息',
autoHeight:true,
items:[{
layout:'column',
items:[ {
columnWidth:.90,
layout: 'form',
items: [{
title:fm,
value: '',
anchor:'90%'
}]
}]
}]
}],
buttons: [{
text: '保存',
handler:function(){
if(top.form.isValid()){
top.form.doAction('submit',{
url:'outGrid.jsp',
method:'post',
params:'',
success:function(form,action){
Ext.Msg.alert('操作','保存成功!');
top.form.reset();
},
failure:function(){
Ext.Msg.alert('操作','服务器出现错误请稍后再试!');
}
});
}
}
},{
text: '重置',
handler:function(){top.form.reset();}
}]
});
top.render(document.body);
});
Ext.grid.CheckColumn = function(config){
Ext.apply(this, config);
if(!this.id){
this.id = Ext.id();
}
this.renderer = this.renderer.createDelegate(this);
};
Ext.grid.CheckColumn.prototype ={
init : function(grid){
this.grid = grid;
this.grid.on('render', function(){
var view = this.grid.getView();
view.mainBody.on('mousedown', this.onMouseDown, this);
}, this);
},
onMouseDown : function(e, t){
if(t.className && t.className.indexOf('x-grid3-cc-'+this.id) != -1){
e.stopEvent();
var index = this.grid.getView().findRowIndex(t);
var record = this.grid.store.getAt(index);
record.set(this.dataIndex, !record.data[this.dataIndex]);
}
},
renderer : function(v, p, record){
p.css += ' x-grid3-check-col-td';
return '<div class="x-grid3-check-col'+(v?'-on':'')+' x-grid3-cc-'+this.id+'"> </div>';
}
};
相关推荐
《深入解析SOS版本控制工具:安装、使用与管理》 在软件开发的历程中,版本控制工具扮演着至关重要的角色。它不仅帮助团队管理代码的变更历史,还提供了协同工作的平台,确保项目的稳定性和可追溯性。SOS版本控制...
### SOS框架搭建详解 #### 一、SOS框架概述 SOS(Sensor Observation Service)是一种标准化的服务模型,用于处理来自传感器网络的数据请求。它作为中间层,连接客户端应用与多种类型的传感器及其数据,使得不同...
Windbg和SOS是Windows操作系统调试中的两个重要工具,它们在软件开发、系统故障排查以及逆向工程中扮演着至关重要的角色。Windbg是一款强大的图形化调试器,由微软提供,支持用户模式和内核模式的调试。而SOS则是...
【SOS调试命令手册】是针对WinDbg调试工具中SOS扩展命令的详细指南,旨在帮助开发者理解和使用这些命令来解决.NET Framework应用程序中的问题。WinDbg是一款强大的调试工具,而SOS则是用于.NET环境的扩展,提供了...
sos系统的安装包,有问题请加qq群:463690330,或访问博客:http://blog.csdn.net/zhangrui_fslib_org/article/details/50535266
【SOS系统】SOS系统,全称Send Our Succour,是一种紧急求救服务系统,尤其在智能手机领域中,它的应用越来越广泛。SOS系统旨在为用户提供快速有效的求助手段,尤其是在危机情况下,如人身安全威胁、健康问题或其他...
SOS closoft的管理者文档
标准作业三单(SOS、JIS、MDS) 标准作业三单是生产流程中的一种重要工具,旨在确保生产过程的标准化、安全性和质量。标准作业三单由三部分组成:标准化操作单(SOS)、岗位指导书单(JIS)和物料数据单(MDS)。 ...
标题 "MCU51 KEIL SOS signal generat SOS信号发生器.zip" 提供的信息表明,这是一个基于MCU51(一款常见的8位微控制器)的项目,使用了KEIL开发环境,目标是生成SOS信号。KEIL是知名的嵌入式系统开发工具,常用于...
1.向日葵SOS版AD域不需要权限(AD域提示需要密码,点取消,防火墙提示也点取消,就能运行) 2.只能被控制。
以下是对"Android完整手电筒源码,SOS报警功能"的详细解析: 1. **硬件权限与API访问**: - Android系统通过权限管理机制控制对硬件资源的访问。在手电筒应用中,需要在`AndroidManifest.xml`文件中声明`android....
### 安装与开发指南:Sensor Observation Service (SOS) 版本3.0.0 #### 一、概述 Sensor Observation Service (SOS) 是一个标准的服务接口,旨在为传感器网络提供统一的数据访问机制。它允许用户通过网络查询...
- **反馈机制**:允许用户提交问题反馈,并跟踪问题处理进度,确保问题得到及时有效的解决。 ### 4. 使用Linux SOS 的步骤 #### 步骤一:识别问题 - **确定问题类型**:首先明确是硬件问题还是软件问题。 - **...
"SOS.exe专杀工具"和"RxpMon.exe病毒专杀软件"是针对特定恶意程序的解决方案,旨在保护计算机系统免受这两类威胁的侵害。这两款工具的主要目标是检测、清除和防止SOS.exe病毒和RxpMon.exe病毒的进一步扩散。 SOS....
共享软件工具 SOS中文版
SOS安装配置指南 本文档是关于SourceOffsite 安装配置指南的详细指导,涵盖了服务端安装、配置、客户端安装等多个方面的知识点。 一、服务端安装 1. 安装 Framework 1.1:双击安装包内的 framework1.1.exe 可执行...
**SOS算法详解** SOS(Sum of Squares)算法是一种在优化问题中广泛应用的求解方法,特别是在处理非线性优化问题时。这个算法基于数学中的平方项和,因此得名“Sum of Squares”。SOS算法的核心是将一个复杂的优化...
SOSTOOLS全称为"Sum of Squares Toolbox",它允许工程师和研究人员使用Sum of Squares (SOS)编程方法来分析和证明系统属性,比如稳定性和渐近稳定性。 Sum of Squares(SOS)是一种数学技术,通过将多项式表示为...
Scrum of Scrums(SoS)是一种用于组织大规模敏捷团队的策略,特别是在多个Scrum团队共同协作开发同一产品时。随着公司规模的扩大,这种协同工作的需求变得日益重要。SoS是解决团队间协调和依赖问题的一种有效方法,...