- 浏览: 83955 次
- 性别:
- 来自: 西安
最新评论
-
xieweiting:
把response返回属性改下, response.setCo ...
http://huoyunshen888.iteye.com/admin/blogs/new
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>分支机构管理</title>
<link rel="stylesheet" type="text/css"
href="../resources/css/ext-all.css" />
<script type="text/javascript" src="../resources/js/ext-base.js"></script>
<script type="text/javascript" src="../resources/js/ext-all.js"></script>
<script type="text/javascript" src="../resources/js/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="../js/company/company.js" defer="defer"></script>
</head>
<body>
<!-- <div id="grid"></div>-->
</body>
</html>
----------------------------------html
Ext.onReady(function() {
var add = new Ext.Window({
title : "添加货物",
hideLabels : false,
width : 280,
height : 410,
closeAction:"hide",
buttonAlign : "left",
items : [
{
items : [{
xtype : "form",
defaultType : "textfield",
id : "form",
labelWidth : 100,
frame : true,
items : [{
fieldLabel : "分支机构名称",
name : "name",
value : "",
allowBlank : false,
blankText : "名称不能为空"
},{
fieldLabel : "固定电话区号码",
name : "",
value : ""
},
{
fieldLabel : "分支机构ID",
name : "companyid",
value : ""
},new Ext.form.ComboBox({
store:new Ext.data.SimpleStore({
fields:['typeID','typeName'],
data:[['0','0'],['1','生产企业'],['2','销售企业'],['3','其他']]
}),
displayField:'typeName',
valueField:'typeID',
mode:'local',
typeAhead:true,
triggerAction:'all',
fieldLabel:'企业类型',
name:'companytype',
allowBlank:false,
editable:false,
width:140,
id:'companytype'
}),{
xtype : "numberfield",
fieldLabel : "负责人",
name : "principal",
value : "",
allowBlank : false,
blankText : "长不能为空"
}, {
xtype : "numberfield",
fieldLabel : "职务",
name : "duty",
value : "",
allowBlank : false,
blankText : "宽不能为空"
}, {
xtype : "numberfield",
fieldLabel : "电话",
name : "phone",
value : "",
allowBlank : false,
blankText : "高不能为空"
}, {
xtype : "numberfield",
fieldLabel : "手机",
name : "mobile",
value : "",
allowBlank : false,
blankText : "高不能为空"
}, {
xtype : "numberfield",
fieldLabel : "传真",
name : "fax",
value : "",
allowBlank : false,
blankText : "高不能为空"
}, {
xtype : "numberfield",
fieldLabel : "详细地址",
name : "address",
value : "",
allowBlank : false,
blankText : "高不能为空"
}, {
xtype : "numberfield",
fieldLabel : "邮编",
name : "postalCode",
value : "",
allowBlank : false,
blankText : "高不能为空"
}, {
xtype : "numberfield",
fieldLabel : "email",
name : "email",
value : "",
allowBlank : false,
blankText : "您输入的电子邮件有误"
}]
}],
buttons : [{
text : "添加",
handler : function() {
Ext.getCmp("form").form.submit({
waitMsg : "正在处理中...",
url : "../company/insertCompany.shtml",
method : "POST",
success : function(action, form) {
Ext.Msg.alert("操作成功");
store.reload();
//window.location.href = "/wutai/company/queryCompanyPagedList.shtml?firstQuery=true&type=0";
add.close();
}
// failure:function(action,form){
// / alert("矢败");
// }
});
}
}, {
text : "重置",
handler : function() {
Ext.getCmp("form").form.reset();
}
}]
}]
});
function handleDelete(){
var selectedKeys = grid.selModel.selections.keys; //returns array of selected rows ids only
if(selectedKeys.length > 0)
{
Ext.MessageBox.confirm('提示','您确实要删除选定的记录吗?', deleteRecord);
}
else
{
Ext.MessageBox.alert('提示','请至少选择一条记录!');
}//end
}
function deleteRecord(btn){
if(btn=='yes'){
var selectedRows = grid.selModel.selections.items;//returns record objects for selected rows (all info for row)
var selectedKeys = grid.selModel.selections.keys;
//var deleteresult = AjaxRequest('/EmployeeService.svc/DelEmployee',selectedKeys,false,"")
Ext.MessageBox.show({
msg: '正在请求数据, 请稍侯',
progressText: '正在请求数据',
width:300,
wait:true,
waitConfig: {interval:200}
});
Ext.Ajax.request({
url: '../company/deleteCompany.shtml', //url to server side script
method: 'POST',
params:Ext.util.JSON.encode(selectedKeys),//the unique id(s)
params:{companyid:grid.getSelectionModel().getSelected().get('companyid')},
//the function to be called upon failure of the request (server script, 404, or 403 errors)
failure:function(response,options){
Ext.MessageBox.hide();
ReturnValue = Ext.MessageBox.alert("警告","出现异常错误!请联系管理员!");
},
success:function(response,options){
Ext.MessageBox.hide();
store.reload();
}
})// end Ajax request
}//end if click 'yes' on button
} // end deleteRecord
// var data=[["1","2","3","4"]];
// var store=new Ext.data.SimpleStore({
// data:data, fields:["sales","state","unit","datatime"]
// });
var sm = new Ext.grid.CheckboxSelectionModel();
var cm = new Ext.grid.ColumnModel([sm,
{header : "公司编号",
dataIndex : "companyid"
}, {
header : "名称",
dataIndex : "name"
}, {
header : "负责人",
dataIndex : "principal"
},{
header : "职务",
dataIndex : "duty"
},{
header : "电话",
dataIndex : "phone"
},{
header : "手机",
dataIndex : "mobile"
},{
header : "传真",
dataIndex : "fax"
},{
header : "地址",
dataIndex : "address"
},{
header : "邮政编码",
dataIndex : "postalCode"
},{
header : "添加时间",
dataIndex : "createtime"
}
]);
var store=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"../company/queryCompanyPagedList.shtml?firstQuery=true&auditingflag=1"}),
reader: new Ext.data.JsonReader({totalProperty: 'totalNum',root: 'root'},["companyid", "name", "principal", "duty", "phone", "mobile", "fax", "address", "posttalcode", "craetetime"])
});
var grid = new Ext.grid.GridPanel({
renderTo : Ext.getBody(),
id : "business",
title : "分支机构管理",
cm : cm,
sm : sm,
height : 570,
store : store,
viewConfig : {
forceFit : true
},
tbar : [{
text : "添加",
listeners : {
"click" : function() {
add.show();
}
}
},'-', {
text : "修改",
listeners : {
"click" : function() {
}
}
},'-',{
text:'删除',
tooltip:'删除记录',
iconCls:'remove',
handler:handleDelete
}
],
bbar : new Ext.PagingToolbar({
displayInfo: true,
displayMsg: '显示 {0} - {1} / {2}',
emptyMsg: '没有数据',
store : store
})
});
store.load({params : {
start:0,
limit : 30
}
})
});
--------------------------------------------------js
public String deleteSalebill() {
try {
HttpServletRequest request = ActionContext.getActionContext().getRequest();
String choice[] = com.wutai.util.EasyStr.splitstring(request.getParameter("ids"));
System.out.println(request.getParameter("ids"));
System.out.println(choice[0]);
for(int i=0;i<choice.length;i++){
SalebillInfo tmpSalebillInfo = new SalebillInfo();
tmpSalebillInfo.setSalebillid(choice[i]);
salebillService.deleteSalebill(tmpSalebillInfo);
}
HttpServletResponse response = ActionContext.getActionContext().getResponse();
System.out.println(this.getSalebillid());
System.out.println(this.getCompanyid());
PrintWriter pw = response.getWriter();
response.getWriter().print("{success:true}");
return null;
} catch (Exception e) {
e.printStackTrace();
return "failure";
}
}
========================forbean
public String querySalebillPagedList(){
try {
HttpServletRequest request = ActionContext.getActionContext().getRequest();
HttpServletResponse response = ActionContext.getActionContext().getResponse();
//String page = request.getParameter("page");
Integer start=Integer.parseInt(request.getParameter("start"));
Integer limit=Integer.parseInt(request.getParameter("limit"));
String page=String.valueOf(start/limit+1);
//String firstquery = request.getParameter("firstQuery");
this.setSearchoption(true);
if (page.equals("1")) {
salebillPagedList = new PagedList();
salebillPagedList.setQueryName("browseSalebill");
request.getSession().removeAttribute(PagedList.NAME);
request.getSession().setAttribute(PagedList.NAME, salebillPagedList);
}else {
salebillPagedList = (PagedList) request.getSession().getAttribute(PagedList.NAME);
if (null == salebillPagedList|| !QUERY_NAME.equalsIgnoreCase(salebillPagedList.getQueryName())) {
logger.error("The query parameter is needed��");
return "failure";
}
}
salebillPagedList = (PagedList)request.getSession().getAttribute(PagedList.NAME);
//设置请求页码
salebillPagedList.setPage(Integer.parseInt(page));
//如果请求的记录不在范围内,就查询数据库。否则直接在PagedList对象里取。
if (!salebillPagedList.exists(Integer.parseInt(page))) {
salebillService.getSalebillPagedList(salebillInfo, salebillPagedList);
}
response.setContentType("application/json;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
PrintWriter pw = response.getWriter();
int total=salebillPagedList.getTotalNum();
String num=String.valueOf(total);
pw.write(Convert.objectcollect2json(salebillPagedList.getList(),num).toString());
//int num=salebillPagedList.getTotalNum();
//s=s.replaceAll(",\"start\":\\d*,\"totalNum\":\\d*,\"totalPage\":\\d*}","}");
//s=s.replaceAll("\"firstPage\":true,\"lastPage\":false,\"list","\"totalProperty\":"+num+",\"root");
return null;
} catch (Exception e) {
e.printStackTrace();
//ActionContext.getActionContext().addErrors("error.exception", e.toString());
return "failure";
}
}
----------------------------------forbean
package com.wutai.util;
import
net.sf.json.*;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
public class Convert {
public static JSONObject generate(List list){
Map<String,Object> map = new HashMap<String, Object>();
map.put("totalProperty",list.size());
map.put("root", list);
return JSONObject.fromObject(map);
}
public static JSONObject javabean2json(Object object){
Map<String,Object> map = new HashMap<String, Object>();
map.put("success",true);
map.put("data",object);
return JSONObject.fromObject(map);
}
public static JSONObject objectcollect2json(List list,String total){
Map<String,Object> map = new HashMap<String, Object>();
map.put("totalProperty",total);
map.put("root",list);
return JSONObject.fromObject(map);
}
}
-------------------------方法
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>分支机构管理</title>
<link rel="stylesheet" type="text/css"
href="../resources/css/ext-all.css" />
<script type="text/javascript" src="../resources/js/ext-base.js"></script>
<script type="text/javascript" src="../resources/js/ext-all.js"></script>
<script type="text/javascript" src="../resources/js/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="../js/company/company.js" defer="defer"></script>
</head>
<body>
<!-- <div id="grid"></div>-->
</body>
</html>
----------------------------------html
Ext.onReady(function() {
var add = new Ext.Window({
title : "添加货物",
hideLabels : false,
width : 280,
height : 410,
closeAction:"hide",
buttonAlign : "left",
items : [
{
items : [{
xtype : "form",
defaultType : "textfield",
id : "form",
labelWidth : 100,
frame : true,
items : [{
fieldLabel : "分支机构名称",
name : "name",
value : "",
allowBlank : false,
blankText : "名称不能为空"
},{
fieldLabel : "固定电话区号码",
name : "",
value : ""
},
{
fieldLabel : "分支机构ID",
name : "companyid",
value : ""
},new Ext.form.ComboBox({
store:new Ext.data.SimpleStore({
fields:['typeID','typeName'],
data:[['0','0'],['1','生产企业'],['2','销售企业'],['3','其他']]
}),
displayField:'typeName',
valueField:'typeID',
mode:'local',
typeAhead:true,
triggerAction:'all',
fieldLabel:'企业类型',
name:'companytype',
allowBlank:false,
editable:false,
width:140,
id:'companytype'
}),{
xtype : "numberfield",
fieldLabel : "负责人",
name : "principal",
value : "",
allowBlank : false,
blankText : "长不能为空"
}, {
xtype : "numberfield",
fieldLabel : "职务",
name : "duty",
value : "",
allowBlank : false,
blankText : "宽不能为空"
}, {
xtype : "numberfield",
fieldLabel : "电话",
name : "phone",
value : "",
allowBlank : false,
blankText : "高不能为空"
}, {
xtype : "numberfield",
fieldLabel : "手机",
name : "mobile",
value : "",
allowBlank : false,
blankText : "高不能为空"
}, {
xtype : "numberfield",
fieldLabel : "传真",
name : "fax",
value : "",
allowBlank : false,
blankText : "高不能为空"
}, {
xtype : "numberfield",
fieldLabel : "详细地址",
name : "address",
value : "",
allowBlank : false,
blankText : "高不能为空"
}, {
xtype : "numberfield",
fieldLabel : "邮编",
name : "postalCode",
value : "",
allowBlank : false,
blankText : "高不能为空"
}, {
xtype : "numberfield",
fieldLabel : "email",
name : "email",
value : "",
allowBlank : false,
blankText : "您输入的电子邮件有误"
}]
}],
buttons : [{
text : "添加",
handler : function() {
Ext.getCmp("form").form.submit({
waitMsg : "正在处理中...",
url : "../company/insertCompany.shtml",
method : "POST",
success : function(action, form) {
Ext.Msg.alert("操作成功");
store.reload();
//window.location.href = "/wutai/company/queryCompanyPagedList.shtml?firstQuery=true&type=0";
add.close();
}
// failure:function(action,form){
// / alert("矢败");
// }
});
}
}, {
text : "重置",
handler : function() {
Ext.getCmp("form").form.reset();
}
}]
}]
});
function handleDelete(){
var selectedKeys = grid.selModel.selections.keys; //returns array of selected rows ids only
if(selectedKeys.length > 0)
{
Ext.MessageBox.confirm('提示','您确实要删除选定的记录吗?', deleteRecord);
}
else
{
Ext.MessageBox.alert('提示','请至少选择一条记录!');
}//end
}
function deleteRecord(btn){
if(btn=='yes'){
var selectedRows = grid.selModel.selections.items;//returns record objects for selected rows (all info for row)
var selectedKeys = grid.selModel.selections.keys;
//var deleteresult = AjaxRequest('/EmployeeService.svc/DelEmployee',selectedKeys,false,"")
Ext.MessageBox.show({
msg: '正在请求数据, 请稍侯',
progressText: '正在请求数据',
width:300,
wait:true,
waitConfig: {interval:200}
});
Ext.Ajax.request({
url: '../company/deleteCompany.shtml', //url to server side script
method: 'POST',
params:Ext.util.JSON.encode(selectedKeys),//the unique id(s)
params:{companyid:grid.getSelectionModel().getSelected().get('companyid')},
//the function to be called upon failure of the request (server script, 404, or 403 errors)
failure:function(response,options){
Ext.MessageBox.hide();
ReturnValue = Ext.MessageBox.alert("警告","出现异常错误!请联系管理员!");
},
success:function(response,options){
Ext.MessageBox.hide();
store.reload();
}
})// end Ajax request
}//end if click 'yes' on button
} // end deleteRecord
// var data=[["1","2","3","4"]];
// var store=new Ext.data.SimpleStore({
// data:data, fields:["sales","state","unit","datatime"]
// });
var sm = new Ext.grid.CheckboxSelectionModel();
var cm = new Ext.grid.ColumnModel([sm,
{header : "公司编号",
dataIndex : "companyid"
}, {
header : "名称",
dataIndex : "name"
}, {
header : "负责人",
dataIndex : "principal"
},{
header : "职务",
dataIndex : "duty"
},{
header : "电话",
dataIndex : "phone"
},{
header : "手机",
dataIndex : "mobile"
},{
header : "传真",
dataIndex : "fax"
},{
header : "地址",
dataIndex : "address"
},{
header : "邮政编码",
dataIndex : "postalCode"
},{
header : "添加时间",
dataIndex : "createtime"
}
]);
var store=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:"../company/queryCompanyPagedList.shtml?firstQuery=true&auditingflag=1"}),
reader: new Ext.data.JsonReader({totalProperty: 'totalNum',root: 'root'},["companyid", "name", "principal", "duty", "phone", "mobile", "fax", "address", "posttalcode", "craetetime"])
});
var grid = new Ext.grid.GridPanel({
renderTo : Ext.getBody(),
id : "business",
title : "分支机构管理",
cm : cm,
sm : sm,
height : 570,
store : store,
viewConfig : {
forceFit : true
},
tbar : [{
text : "添加",
listeners : {
"click" : function() {
add.show();
}
}
},'-', {
text : "修改",
listeners : {
"click" : function() {
}
}
},'-',{
text:'删除',
tooltip:'删除记录',
iconCls:'remove',
handler:handleDelete
}
],
bbar : new Ext.PagingToolbar({
displayInfo: true,
displayMsg: '显示 {0} - {1} / {2}',
emptyMsg: '没有数据',
store : store
})
});
store.load({params : {
start:0,
limit : 30
}
})
});
--------------------------------------------------js
public String deleteSalebill() {
try {
HttpServletRequest request = ActionContext.getActionContext().getRequest();
String choice[] = com.wutai.util.EasyStr.splitstring(request.getParameter("ids"));
System.out.println(request.getParameter("ids"));
System.out.println(choice[0]);
for(int i=0;i<choice.length;i++){
SalebillInfo tmpSalebillInfo = new SalebillInfo();
tmpSalebillInfo.setSalebillid(choice[i]);
salebillService.deleteSalebill(tmpSalebillInfo);
}
HttpServletResponse response = ActionContext.getActionContext().getResponse();
System.out.println(this.getSalebillid());
System.out.println(this.getCompanyid());
PrintWriter pw = response.getWriter();
response.getWriter().print("{success:true}");
return null;
} catch (Exception e) {
e.printStackTrace();
return "failure";
}
}
========================forbean
public String querySalebillPagedList(){
try {
HttpServletRequest request = ActionContext.getActionContext().getRequest();
HttpServletResponse response = ActionContext.getActionContext().getResponse();
//String page = request.getParameter("page");
Integer start=Integer.parseInt(request.getParameter("start"));
Integer limit=Integer.parseInt(request.getParameter("limit"));
String page=String.valueOf(start/limit+1);
//String firstquery = request.getParameter("firstQuery");
this.setSearchoption(true);
if (page.equals("1")) {
salebillPagedList = new PagedList();
salebillPagedList.setQueryName("browseSalebill");
request.getSession().removeAttribute(PagedList.NAME);
request.getSession().setAttribute(PagedList.NAME, salebillPagedList);
}else {
salebillPagedList = (PagedList) request.getSession().getAttribute(PagedList.NAME);
if (null == salebillPagedList|| !QUERY_NAME.equalsIgnoreCase(salebillPagedList.getQueryName())) {
logger.error("The query parameter is needed��");
return "failure";
}
}
salebillPagedList = (PagedList)request.getSession().getAttribute(PagedList.NAME);
//设置请求页码
salebillPagedList.setPage(Integer.parseInt(page));
//如果请求的记录不在范围内,就查询数据库。否则直接在PagedList对象里取。
if (!salebillPagedList.exists(Integer.parseInt(page))) {
salebillService.getSalebillPagedList(salebillInfo, salebillPagedList);
}
response.setContentType("application/json;charset=UTF-8");
response.setCharacterEncoding("UTF-8");
PrintWriter pw = response.getWriter();
int total=salebillPagedList.getTotalNum();
String num=String.valueOf(total);
pw.write(Convert.objectcollect2json(salebillPagedList.getList(),num).toString());
//int num=salebillPagedList.getTotalNum();
//s=s.replaceAll(",\"start\":\\d*,\"totalNum\":\\d*,\"totalPage\":\\d*}","}");
//s=s.replaceAll("\"firstPage\":true,\"lastPage\":false,\"list","\"totalProperty\":"+num+",\"root");
return null;
} catch (Exception e) {
e.printStackTrace();
//ActionContext.getActionContext().addErrors("error.exception", e.toString());
return "failure";
}
}
----------------------------------forbean
package com.wutai.util;
import
net.sf.json.*;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
public class Convert {
public static JSONObject generate(List list){
Map<String,Object> map = new HashMap<String, Object>();
map.put("totalProperty",list.size());
map.put("root", list);
return JSONObject.fromObject(map);
}
public static JSONObject javabean2json(Object object){
Map<String,Object> map = new HashMap<String, Object>();
map.put("success",true);
map.put("data",object);
return JSONObject.fromObject(map);
}
public static JSONObject objectcollect2json(List list,String total){
Map<String,Object> map = new HashMap<String, Object>();
map.put("totalProperty",total);
map.put("root",list);
return JSONObject.fromObject(map);
}
}
-------------------------方法
发表评论
-
Add a StatusBar to a window
2011-08-10 22:30 1002<html> <head> <t ... -
ExtJs表格点击超链接获取行的值
2011-08-03 23:53 1687grid双击事件,并得到单 ... -
extjs
2011-07-31 10:42 750var record_start=0; columns:[n ... -
ExtJs分页精解(java应用)
2011-07-28 21:48 1105ExtJs的分页做的相当出色!在此,我们简单的分析一下它的分页 ... -
ExtJs实现EditGrid中的增删改查操作(2)
2011-07-27 23:18 45342.本例是在ExtJs官方提供 ... -
ExtJS GridPanel分页、添加、删除、修改
2011-07-27 23:07 2279CheckboxSelectionModel是grid的选择模 ... -
extjs
2011-07-24 14:14 884我想改变默认extjs字体的大小,应该怎么做? AJAX读 ... -
http://huoyunshen888.iteye.com/admin/blogs/new
2011-07-24 13:23 890我用extjs+struts1.2做文件上传时,当文件上传成功 ... -
ext
2011-07-24 10:51 1162<%@ page language="java ... -
ExtJS 初步應用 ProgressBar
2011-07-06 22:51 1015<!DOCTYPE HTML PUBLIC " ... -
extjs combox
2011-07-06 22:24 1113var crdtypeStore_CX = new Ext.d ... -
extjs开发包
2011-07-05 21:24 720
相关推荐
它可能包含了创建表单、动态添加和删除字段的逻辑,以及与服务器通信的代码。通过阅读和分析这个文件,我们可以更深入地了解如何在实际项目中应用这些技术。 总之,动态添加表单是ExtJS开发中的一个重要技巧,它...
Store的`load`方法用于从服务器加载数据,`store.load({params: {id: someId}})`。而`store.sync()`则用于将Store中的所有添加、修改和删除操作提交到服务器。 8. 综合应用: 结合使用这些组件和方法,可以在用户...
理解TreePanel的使用涉及节点操作(添加、删除、展开、折叠)、树状数据模型以及拖放功能的实现。 4. **Ext中几个get开头的方法**: ExtJS提供了许多以`get`开头的方法,用于获取组件实例、数据视图、数据记录等。...
"大数据量高性能前端表格grid 动态加载数据"这一技术主题,旨在优化用户体验,解决因一次性加载大量数据导致的页面卡顿问题。本文将深入探讨如何实现这种高效的数据加载策略。 首先,"高性能grid"是指一种能够快速...
4. **加载数据**:使用`loadData`方法将数据加载到TreePanel中。数据可以是预定义的,也可以通过Ajax请求动态获取。 5. **启用编辑**:EXTJS提供了`TreeEditor`类,用于启用树节点的编辑功能。我们需要配置编辑器,...
总结来说,结合ExtJS4的Grid组件和Servlet,我们可以构建出一个功能完善的Web应用,支持动态加载数据、行内编辑以及基本的CRUD操作。这种组合既提供了美观的前端用户体验,也确保了与服务器的高效通信,是企业级Web...
1. Store:存储数据的容器,可以从服务器加载数据,支持数据的读取、添加、删除和更新。 2. Proxy:与服务器通信的中介,处理数据的获取和提交,支持Ajax和ScriptTag两种模式。 3. Model:定义数据字段和验证规则...
autoLoad: true // 自动加载数据 }); ``` 在上述代码中,我们使用了Ajax代理来连接服务器,通过URL获取JSON格式的数据。`reader`配置项用于解析服务器返回的数据,`rootProperty`指定了数据在JSON对象中的位置。 ...
本书共分17章,分别介绍了JavaScript的对象编程、JavaScript浏览器对象模型和事件机制、ExtJS的核心类库和组件、ExtJS的事件处理方式、设计进度条、设计工具栏和菜单栏、设计面板、设计表格、设计表单、设计数据表、...
在本示例中,我们将深入探讨如何使用ExtJS实现动态加载grid,同时实现CRUD(创建、读取、更新、删除)操作和分页功能。 首先,让我们了解什么是Grid。在ExtJS中,Grid是一种数据网格组件,用于展示大量结构化数据。...
2. **管理员**:除了普通用户的所有权限外,还具有管理整个博客系统(如添加/删除日志、管理评论等)的能力。 #### 四、域模型设计 **概述:** 域模型设计是系统开发的重要组成部分,它定义了系统的核心实体、属性...
动态树(Dynamic Tree)是指在运行时可以动态加载、添加、删除或更新节点的树形控件。在ExtJS中,这种功能主要通过`Ext.tree.TreePanel`或其现代版本`Ext.tree.View`来实现。 一、ExtJS 动态树基础 1. `Ext.tree....
动态加载通常通过配置`rootVisible: false`、`loadMask: true`以及设置`treeStore`的`proxy`和`autoload`属性来实现,同时配合使用`treeStore.load()`方法来异步加载数据。 接下来是增删改查(CRUD)操作。在ExtJS ...
- **编辑功能**:支持网格内编辑、添加/删除行、脏数据提示等。 - **交互性**:支持行或列之间的拖拽操作。 **局限性**: - 不支持列锁定功能(在早期版本中曾有此功能,但因性能问题被移除)。 - 缺乏默认的统计...
总的来说,这个示例将帮助我们理解如何使用ExtJS的Store、Model、Proxy和Controller等组件与后台服务器进行有效的数据交互,从而实现数据的加载、添加、编辑和删除等操作。通过学习这个示例,开发者可以掌握如何构建...
机构树的节点支持动态添加、修改和删除,这样能够灵活地调整和维护组织架构。 右侧的查询列表则展示了相关的数据列表,如用户列表、角色列表等,根据当前选中的机构节点,列表会动态加载对应的数据。列表一般具有...
4、Grid列表和表单,包含添加、删除、批量删除、修改、查看、图片查看和按条件查询列表等功能。 5、导入导出Excel数据,支持xlsx和xls文件。 6、资源管理(菜单管理)。 7、用户管理和部门管理。 8、...
在PHP和ExtJS框架下,实现数据加载到Grid控件是一项常见的任务,特别是在构建Web应用程序时,用于展示和管理大量的结构化数据。ExtJS Grid是一个强大的数据网格组件,它可以高效地展示和操作表格数据,而PHP则作为...
ExtJS4的Store组件可以方便地处理这种数据加载和提交,它与Model类一起,定义了数据字段和行为,使数据操作更加规范和易于管理。 在"Ext4_SMS"这个压缩包中,可能包含了以下文件和目录: 1. `app.js`: 应用主入口...
在实际项目中,当数据量较大时,直接加载所有数据到前端可能会导致页面加载时间过长甚至崩溃,因此需要实现后台分页功能。后台分页的核心在于服务器端只返回当前页的数据,前端负责显示这部分数据并提供翻页功能。在...