- 浏览: 545491 次
- 性别:
- 来自: 广州
-
文章分类
- 全部博客 (339)
- JavaBase (27)
- J2EE (70)
- Database (22)
- Spring (3)
- struts1.x (6)
- struts2.x (16)
- Hibernate (10)
- IBatis (4)
- DWR (1)
- SSH (5)
- Oracle (31)
- HTML (12)
- javascript (11)
- Thinking (3)
- Workflow (5)
- Live (13)
- Linux (23)
- ExtJS (35)
- flex (10)
- php (3)
- Ant (10)
- ps (1)
- work (2)
- Test (1)
- Regular Expressions (2)
- HTTPServer (2)
- 方言 (1)
- 生活 (2)
- Sybase PowerDesigner (0)
最新评论
-
mikey_5:
非常感谢楼主的分享,<parameter propert ...
Check the output parameters (register output parameters failed) IN Ibatis -
影子_890314:
我现在也有这个错误,求解!
Check the output parameters (register output parameters failed) IN Ibatis -
358135071:
学习了,感谢分享!
使用hibernate 代替 mysql 中 limit 進行分頁 -
wjpiao:
你下面的“正确的映射”里面不是还是有number类型吗?
Check the output parameters (register output parameters failed) IN Ibatis -
zh_s_z:
很有用!弄一份吧!
Oracle数据库分区表操作方法
/*
*
*/
Ext.onReady(function() {
Ext.BLANK_IMAGE_URL = 'admin/ext/resources/images/default/s.gif';
/*
* clear error'Permission denied to access property 'dom' from a non-chrome
* context' method
*/
Ext.override(Ext.Element, {
contains : function() {
var isXUL = Ext.isGecko ? function(node) {
return Object.prototype.toString.call(node) == '[object XULElement]';
}
: Ext.emptyFn;
return function(el) {
return !this.dom.firstChild || // if this Element has no
// children, return false
// immediately
!el || isXUL(el) ? false : Ext.lib.Dom.isAncestor(
this.dom, el.dom ? el.dom : el);
};
}()
});
/* filed declare */
var addWindowTitle = '新增用戶等級信息';
var searchWindowTitle = '查詢用戶等級信息';
var editWindowTitle = '修改用戶等級信息';
var store = null;
var start = 0;
var limit = 10;
var pageSize = 10;
// var url = 'user.do?op=doLoadUserById';
var url = 'userGrade.do?op=';
var displayDiv = 'divUserGradeGrid';
var formPanel = null;
var searchFormPanel = null;
var window = null;
var searchWin = null;
var primaryKey = 'gradeId';
var recordMapping = ['gradeId', 'userGrade', 'lowerTotal', 'highTotal',
'discount', 'remark'];
var combobox = null;
/*------------------------------------ declare data store begin ---------------------------------------------*/
store = new Ext.data.Store({
autoLoad : {
params : {
start : start,
limit : limit,
type : 'load'
}
},
reader : new Ext.data.JsonReader({
totalProperty : 'results',
root : 'items',
id : primaryKey,
fields : recordMapping
}),
proxy : new Ext.data.HttpProxy({
/* load news list URL */
url : url + 'doLoadListByPaging',
method : 'POST'
})
});
/*------------------------------------ declare data store end ---------------------------------------------*/
/*------------------------------------ declare window element begin ---------------------------------------------*/
/* setting toolbar */
var pageBar = new Ext.PagingToolbar({
store : store,
plugins : new Ext.ux.grid.PageSizePlugin(),
pageSize : pageSize,
displayInfo : true,
displayMsg : '第 {0} 條到 {1} 條, 一共 {2} 條',
emptyMsg : '沒有找到記錄'
});
var toolBar = new Ext.Toolbar([{
text : '新增等級',
tooltip : '新增等級',
iconCls : 'add',
handler : showAddWindow
}, {
text : '修改等級',
tooltip : '修改等級',
iconCls : 'option',
handler : showModifyWindow
}, {
text : '刪除等級',
tooltip : '刪除等級',
iconCls : 'remove',
handler : showDeleteDialog
}, '-', {
text : '刷新',
iconCls : 'refresh',
tooltip : '刷新',
handler : refresh
}, {
text : '查詢',
tooltip : '查詢',
iconCls : 'search',
width : 5,
handler : showSearchWindow
}]);
/* declare news grid */
var sm = new Ext.grid.CheckboxSelectionModel();
var userGrid = new Ext.grid.GridPanel({
// title : '會員等級列表',
applyTo : displayDiv,
autoHeight : true,
viewConfig : {
autoFill : true
},
frame : true,
tbar : toolBar,
bbar : pageBar,
sm : sm,
store : store,
columns : [sm, new Ext.grid.RowNumberer({
header : '行號',
width : 40,
dataIndex : 'id',
sortable : true
}), {
header : '編號',
tooltip : '編號',
dataIndex : 'gradeId',
sortable : true
}, {
header : '會員等級',
dataIndex : 'userGrade',
tooltip : '會員等級',
sortable : true
}, {
header : '消費下限',
dataIndex : 'lowerTotal',
tooltip : '消費下限',
sortable : true
}, {
header : '消費上限',
dataIndex : 'highTotal',
tooltip : '消費上限',
sortable : true
}, {
header : '折扣',
dataIndex : 'discount',
tooltip : '折扣',
sortable : true
}, {
header : '備註',
tooltip : '備註',
dataIndex : 'remark',
sortable : true
}]
});
/* declare FormPanel */
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
formPanel = new Ext.form.FormPanel({
id : 'formPanel',
labelSeparator : ':',
frame : true,
border : false,
buttons : [{
text : '確認',
handler : submitForm
}, {
text : '關閉',
handler : function() {
window.hide();
}
}],
items : [{
xtype : 'numberfield',
width : 200,
allowBlank : false,
blankText : '等級不能為空',
name : 'userGrade',
minLength : 1,
minLengthText : '请您输入最少1个字符',
maxLength : 20,
maxLengthText : '请您输入最多20个字符',
vtype : 'alphanum',
fieldLabel : '用戶等級'
}, {
xtype : 'numberfield',
width : 200,
allowBlank : false,
blankText : '上限不能為空',
name : 'highTotal',
minLength : 1,
minLengthText : '请您输入最少1个字符',
maxLength : 20,
maxLengthText : '请您输入最多20个字符',
// vtype:'alphanum',
fieldLabel : '最底消費'
}, {
xtype : 'numberfield',
width : 200,
allowBlank : false,
blankText : '下限不能為空',
name : 'lowerTotal',
minLength : 1,
minLengthText : '请您输入最少1个字符',
maxLength : 20,
maxLengthText : '请您输入最多20个字符',
vtype : 'alphanum',
fieldLabel : '最高消費'
}, {
xtype : 'numberfield',
width : 200,
allowBlank : false,
blankText : '折扣不能為空',
name : 'discount',
minLength : 1,
minLengthText : '请您输入最少1个字符',
// maxLength : 20,
// maxLengthText : '请您输入最多20个字符',
fieldLabel : '折 扣'
}, {
xtype : 'textarea',
width : 200,
allowBlank : true,
blankText : '',
name : 'remark',
fieldLabel : '備 註'
}, {
xtype : 'hidden',
name : 'gradeId'
}]
});
searchFormPanel = new Ext.form.FormPanel({
id : 'searchFormPanel',
labelSeparator : ':',
frame : true,
border : false,
buttons : [{
text : '確認',
handler : searchSubmitForm
}, {
text : '關閉',
handler : function() {
searchWindow.hide();
}
}],
items : [{
xtype : 'numberfield',
width : 200,
id : 'userGrade',
// allowBlank : false,
// blankText : '等級不能為空',
name : 'userGrade',
// minLength : 1,
// minLengthText : '请您输入最少1个字符',
// maxLength : 20,
// maxLengthText : '请您输入最多20个字符',
// vtype : 'alphanum',
fieldLabel : '用戶等級'
// }, {
// xtype : 'numberfield',
// width : 200,
// // allowBlank : false,
// // blankText : '上限不能為空',
// name : 'highTotal',
// // minLength : 1,
// // minLengthText : '请您输入最少1个字符',
// // maxLength : 20,
// // maxLengthText : '请您输入最多20个字符',
// // vtype:'alphanum',
// fieldLabel : '最底消費'
// }, {
// xtype : 'numberfield',
// width : 200,
// // allowBlank : false,
// // blankText : '下限不能為空',
// name : 'lowerTotal',
// // minLength : 1,
// // minLengthText : '请您输入最少1个字符',
// // maxLength : 20,
// // maxLengthText : '请您输入最多20个字符',
// // vtype : 'alphanum',
// fieldLabel : '最高消費'
}, {
xtype : 'numberfield',
id : 'discount',
name : 'discount',
width : 200,
// allowBlank : false,
// blankText : '折扣不能為空',
// minLength : 1,
// minLengthText : '请您输入最少1个字符',
// maxLength : 20,
// maxLengthText : '请您输入最多20个字符',
fieldLabel : '折 扣'
}, {
xtype : 'textarea',
id : 'remark',
name : 'remark',
width : 200,
allowBlank : true,
blankText : '',
fieldLabel : '備 註'
}]
});
/* declare windows */
window = new Ext.Window({
layout : 'fit',
width : 380,
closeAction : 'hide',
height : 280,
resizable : false,
shadow : true,
modal : true,
closable : true,
bodyStyle : 'padding:5 5 5 5',
items : [formPanel],
animCollapse : true
});
/* declare windows */
searchWindow = new Ext.Window({
layout : 'fit',
width : 380,
closeAction : 'hide',
height : 220,
resizable : false,
shadow : true,
// modal : true,
closable : true,
bodyStyle : 'padding:5 5 5 5',
items : [searchFormPanel],
animCollapse : true
});
/*------------------------------------ declare window element end ---------------------------------------------*/
/*------------------------------------ declare function begin ---------------------------------------------*/
/* prosess function */
function showSearchWindow() {
searchWindow.getComponent('searchFormPanel').form.reset();
searchWindow.setTitle(searchWindowTitle);
searchWindow.show();
}
function refresh() {
store.removeAll();
store.load({
params : {
start : start,
limit : limit,
type : 'load'
}
});
}
function showAddWindow() {
/* use FormPanel.reset() */
window.getComponent('formPanel').form.reset();
window.getComponent('formPanel').isAdd = true;
window.setTitle(addWindowTitle);
window.show();
}
function getSelectList() {
var list = [];
userGrid.getSelectionModel().each(function(record) {
list.push(record.get(primaryKey));
});
if (list.length == 0) {
Ext.Msg.alert('提示', '請選擇一行需要操作的數據');
} else {
return list;
}
}
function loadForm(itemId) {
window.getComponent('formPanel').form.load({
waitTitle : '提示',
waitMsg : '數據載入中........',
url : url + 'doLoadItemById',
params : {
itemId : itemId
},
method : 'POST',
success : function(form, action) {
Ext.Msg.alert('提示', '載入成功!');
},
failure : function(form, action) {
Ext.Msg.alert('提示', '載入失敗!');
}
});
}
function showModifyWindow() {
var itemList = getSelectList();
var size = 0;
if (itemList) {
size = itemList.length;
}
// alert(size);
if (size > 1) {
Ext.Msg.alert('提示', '一次只能修改一條數據');
} else if (size == 1) {
window.getComponent('formPanel').form.reset();
window.getComponent('formPanel').isAdd = false;
window.setTitle(editWindowTitle);
var itemId = itemList[0];
window.show();
loadForm(itemId);
}
}
function showDeleteDialog() {
var itemIDList = getSelectList();
var size = 0;
if (itemIDList) {
size = itemIDList.length;
}
if (size == 0) {
return;
}
Ext.Msg.confirm('提示', '確定要刪除所選的記錄嗎?', function(id) {
if (id == 'yes') {
deleteItemList(itemIDList);
}
})
}
function deleteItemList(itemIDList) {
var itemIDListString = itemIDList.join('-');
var msgTip = Ext.Msg.show({
title : '提示',
width : 250,
msg : '正在刪除中.....'
});
Ext.Ajax.request({
url : url + 'doDeleteItemById',
params : {
itemIDListString : itemIDListString
},
method : 'POST',
success : function(response, options) {
msgTip.hide();
var result = Ext.util.JSON
.decode(response.responseText);
if (result.success) {
for (var i = 0; i < itemIDList.length; i++) {
var index = store.find(primaryKey,
itemIDList[i]);
if (index != -1) {
var record = store.getAt(index);
store.remove(record);
}
}
Ext.Msg.alert('提示', '刪除操作成功!');
} else {
Ext.Msg.alert('提示', '刪除操作失敗!');
}
},
failure : function(response, options) {
msgTip.hide();
Ext.Msg.alert('提示', '刪除操作失敗!');
}
})
}
/*------------------------------------- add and update process function begin ---------------------------------*/
function submitForm() {
if (window.getComponent('formPanel').form.isValid()) {
Ext.MessageBox.confirm('提示', '確定要提交嗎?', doSubmitForm);
}
}
function doSubmitForm(id) {
if (id == 'yes') {
// confirm submit
if (window.getComponent('formPanel').isAdd) {
// add user
window.getComponent('formPanel').form.submit({
clientValidation : true,
waitMsg : '正在提交數據.....',
waitTitle : '提示',
url : url + 'doAddItem',
method : 'POST',
success : function(form, action) {
window.hide();
updateUser(action.result.pKey);
Ext.Msg.alert('提示', '新增數據成功!');
},
failure : function(form, action) {
Ext.Msg.alert('提示', '新增數據失敗!'
+ action.result.message);
}
});
} else {
// update user
window.getComponent('formPanel').form.submit({
clientValidation : true,
waitMsg : '正在提交數據.....',
waitTitle : '提示',
url : url + 'doUpdateItem',
method : 'POST',
success : function(form, action) {
window.hide();
updateUser(action.result.pKey);
Ext.Msg.alert('提示', '修改數據成功!');
},
failure : function(form, action) {
Ext.Msg.alert('提示', '修改數據失敗!');
}
});
}
} else {
// cancel submit
return;
}
}
/*------------------------------------- add and update process function end ---------------------------------*/
/*------------------------------------- search process function begin ---------------------------------*/
function searchSubmitForm() {
Ext.MessageBox.confirm('提示', '確定要提交嗎?', doSearchSubmitForm);
}
function doSearchSubmitForm(id) {
if (id == 'yes') {
// saerch form submit
var userGrade = Ext.getCmp('userGrade').getValue();
var discount = Ext.getCmp('discount').getValue();
var remark = Ext.getCmp('remark').getValue();
alert(userGrade + " - " + discount + " - " + remark);
store.load({
params : {
start : start,
limit : limit,
type : 'search',
userGrade : userGrade,
discount : discount,
remark : remark
}
});
}
}
/*------------------------------------- search process function end ---------------------------------*/
function updateUser(pKey) {
var fields = getFormFieldsObj(pKey);
/* userId 是變化的 */
var index = store.find(primaryKey, fields.gradeId)
if (index != -1) {
var item = store.getAt(index);
for (var filedName in fields) {
item.set(filedName, fields[filedName]);
}
store.commitChanges();
} else {
var recordTemp = new Ext.data.Record(fields);
store.add(recordTemp);
}
}
/* get form data */
function getFormFieldsObj(pKey) {
var fields = window.getComponent('formPanel').items;
var obj = {};
for (var i = 0; i < fields.length; i++) {
var item = fields.itemAt(i);
var value = item.getValue();
if (item.getXType() == 'combo') {
var index = item.store.find('id', value);
if (index != -1) {
var selItem = item.store.getAt(index);
}
value = selItem.get('title');
}
obj[item.name] = value;
}
if (Ext.isEmpty(obj[primaryKey])) {
obj[primaryKey] = pKey;
}
return obj;
}
/*------------------------------------ declare function end ---------------------------------------------*/
});
发表评论
-
纵向Tab ---ext
2010-09-28 16:02 1254net address: http://carina. ... -
js code compress
2010-06-11 01:22 1013文章转自: http://www.rainway.org/20 ... -
Ext.data.Store
2010-04-16 21:26 1466原文: http://www.9iext.cn/thr ... -
ExtJs 确认密码验证的两种实现
2010-03-17 16:36 5070实现1: ************************* ... -
extjs换肤
2010-02-26 14:15 1245extjs换肤 http://www.javachen ... -
ext 教程
2010-01-29 17:05 1012关于Ext 扩展比较好的文章: http:// ... -
demo
2010-01-26 20:11 1227一、下载extjs 1、从http://www.extj ... -
你的水平 字段没超出所以没 滚动条!
2009-12-16 21:36 1108你的水平 字段没超出所以没 滚动条! 你试下吧 colu ... -
在EXT中使用FCKEditor编辑器例子
2009-12-15 16:47 1264... -
js oo
2009-12-15 10:22 864var RectAngle = function(width, ... -
costom extend
2009-12-15 09:06 952//自定義繼承 ---------------------- ... -
Ext extend
2009-12-14 23:56 1324第一章 必须理解Ext.extend ... -
JS中的 prototype的含义
2009-12-14 22:02 1792搜了两 个认为好的讲解 Prototype 属性的 ... -
想起温习一下JS中的this apply call arguments
2009-12-14 21:03 1198很多时候讲到语言入门,大家会认为就是要了 ... -
阅读 Ext 学习Javascript(一)Core/Ext.js
2009-12-14 20:46 977从Library的角度 ... -
阅读Ext学习Js(二)---extend从继承说起
2009-12-14 20:45 1095一般的,如果我们定义一个类,会定义一个function对象,然 ... -
Extjs 研究: js基础
2009-12-14 20:33 10871.我们写的变量 ,函 ... -
ExtJS 入门之一 类与继承
2009-12-14 20:08 815在项目中使用ExtJS已经 ... -
Ext表單中一行多列的布局
2009-12-07 08:01 3880var simpleForm = new Ext.Form ... -
extend Ext component demo
2009-12-06 14:01 896extjs的Ext.extend的使用样例(Ext继承) ...
相关推荐
DirectJNgine与Ext Direct是两种技术,它们主要用于在Web应用程序中实现客户端(通常是JavaScript)与服务器端(通常是Java)的高效通信。本教程将通过七个步骤,介绍如何使用DirectJNgine和Ext Direct来调用Java...
method=jsonSave&rIdList=" + Ext.getCmp("rIdList").getValue(), success: function(form, action){ if (action.result.success == "true") { var msg = action.result.msg; // 获取后端返回的消息 // 可以在...
fd=Ext.DomHelper.append(Ext.getBody(),{tag:'form',method:'post',id:'frmDummy',action:'exportexcel.jsp', target:'_blank',name:'frmDummy',cls:'x-hidden',cn:[ {tag:'input',name:'exportContent',id:'...
根据提供的文件信息,我们可以梳理出一系列与Ext框架相关的知识点,主要涵盖了Ext框架的基本用法、配置设置、Ajax请求处理以及自定义组件等几个方面。下面将详细解释这些知识点。 ### 1. Ext框架中的基本配置 ####...
method: 'POST', params: { username: form.findField('username').getValue(), password: form.findField('password').getValue() }, success: function(response) { var result = Ext.decode(response....
- **method**: HTTP请求方法,通常是GET或POST。 - **callback**: 接收响应后执行的函数,无论成功或失败。 - **success**: 请求成功时的回调函数。 - **failure**: 请求失败时的回调函数。 - **form**: 提交的表单...
### Ext与后台服务器的交互操作 #### 一、概述 在现代Web开发中,前端框架如Ext JS(简称EXT)扮演着重要的角色,特别是在企业级应用中。Ext JS以其丰富的UI组件库、强大的数据处理能力和良好的用户体验而受到...
### 关于Ext TreeGrid分页与可编辑功能的实现 #### 一、背景与目标 在Web应用开发中,特别是涉及到复杂数据展示的应用场景中,`Ext TreeGrid`是一种非常实用且灵活的数据展示组件,它结合了树形结构与表格的形式来...
method: 'GET', success: function(response) { var jsonData = Ext.decode(response.responseText); // 创建数据模型 var MyModel = Ext.define('MyModel', { extend: 'Ext.data.Model', fields: jsonData...
method: 'POST', params: formData, success: function(response) { // 处理成功回调 }, failure: function(response) { // 处理失败回调 } }); }); }); ``` 在服务器端,`upload_handler.jsp`将接收到...
3. **method**:"get"或"post",定义了表单提交的方法。 4. **url**:指定表单提交的目标URL。 5. **submit**:定义提交表单的操作,可以是一个函数。 #### FormPanel与FieldSet的结合使用 `FieldSet`组件可以嵌入...
在EXTJS库中,`Ext.Ajax.request`是用于发送Ajax请求的核心方法,它支持异步和同步操作。本文将详细解析如何利用`Ext.Ajax.request`实现同步请求,并探讨其背后的原理和注意事项。 首先,我们需要理解Ajax的本质,...
在EXTJS中,文件上传通常会用到`Ext.form.Panel`组件,它包含一个或多个`Ext.form.field.File`(文件选择字段),也被称为“上传按钮”。这个组件允许用户选择本地文件,并在提交表单时将文件数据发送到服务器。以下...
method: 'POST', success: function(response) { console.log(response.responseText); } }); ``` - **ColdFusion**:EXT也支持与其他语言(如ColdFusion)的交互。 ```javascript new Ext.Ajax.Request({...
Remote method invocation with Ext Direct Chapter 12. Drag-and-drop Part 3: Building an application Chapter 13. Class system foundations Chapter 14. Building an application Book Details Title: Ext JS...
method: 'GET', withCredentials: true, headers: { 'Access-Control-Allow-Origin': '*' }, success: function(response) { // 处理成功响应 }, failure: function(response) { // 处理失败响应 } }); ...
在EXT.NET中,可以使用Server Control或DirectMethod来处理这些后台逻辑。 为了确保用户隐私,务必在调用摄像头前明确告知用户,并获取他们的许可。此外,考虑到Flash的安全性和浏览器支持度逐渐下降,现代的解决...
// 示例代码:loginForm.GetForm().Submit(new { url: "/Account/Login", method: "POST" }); } } }; ``` 6. **整合并显示**: 将这些组件添加到表单中,并将表单添加到页面上: ```csharp loginForm.Items...
method: 'GET', 成功: function(response) { var data = Ext.decode(response.responseText); console.log(data); }, 失败: function(response) { console.error('Failed to load data.'); } }); ``` #### ...
method: 'GET' }), reader: new Ext.data.JsonReader({}, PersonRecord), remoteSort: true }); ``` 在这个例子中,当`store`加载数据时,会自动将`sort`和`dir`参数发送到服务器端。 #### 六、从store中获取...