87,907
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript">
Ext.onReady(function(){
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
var top = new Ext.FormPanel({
labelWidth: 70,
frame:true,
title: '系统设置',
bodyStyle: 'padding:5px 5px 0',
style: 'margin: 10px',
width: 700,
defaults: {width: 230},
defaultType: 'textfield',
items: [{
fieldLabel: '标 题',
name: 'title'
},{
fieldLabel: '短标题',
name: 'shorttitle'
},{
xtype:'combo',
store: new Ext.data.SimpleStore({
fields: ["retrunValue", "displayText"],
data: [[0,'无']]
}),
valueField :"retrunValue",
displayField: "displayText",
mode: 'local',
editable: false,
forceSelection: true,
triggerAction: 'all',
hiddenName:'category',
fieldLabel: '分 类',
emptyText:'选择分类',
name: 'category'
},{
fieldLabel: '作 者',
name: 'author'
},{
fieldLabel: '来 源',
name: 'source'
},{
xtype:'textarea',
fieldLabel: '摘 要',
id:'brief',
name: 'brief'
},{
xtype: 'htmleditor',
fieldLabel: '内 容',
width: 500,
name: 'content',
fontFamilies: ['宋体','黑体']
},{
xtype:'combo',
store: new Ext.data.SimpleStore({
fields: ["retrunValue", "displayText"],
data: [[1,'显示'],[0,'隐藏']]
}),
valueField :"retrunValue",
displayField: "displayText",
mode: 'local',
editable: false,
forceSelection: true,
triggerAction: 'all',
hiddenName:'status',
fieldLabel: '状 态',
emptyText:'选 择',
name: 'status',
value: 0
},{
xtype:'hidden',
name: 'id',
id:'id',
value: ''
}],
buttons: [{
text: '确定',
handler:function(){
if(top.form.isValid()){
top.form.doAction('submit',{
url:'index2.php?model=news&action=save',
method:'post',
params:'',
success:function(form,action){
Ext.Msg.alert('操作','保存成功!');
},
failure:function(){
Ext.Msg.alert('操作','服务器出现错误请稍后再试!');
}
});
}
}
},{
text: '重置',
handler:function(){
Ext.Msg.alert('操作','服务器出现错误请稍后再试!');
top.form.reset();
}
}]
});
top.render(document.body);
//loadend();
});
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Grid3 Example</title>
<link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" />
<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all.js"></script>
<script type="text/javascript" src="common.js"></script>
<style type="text/css">
.add {
background-image:url(images/icons/fam/add.gif) !important;
}
.option {
background-image:url(images/icons/fam/plugin.gif) !important;
}
.remove {
background-image:url(images/icons/fam/delete.gif) !important;
}
</style>
</head>
<body>
<script type="text/javascript">
Ext.onReady(function(){
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
var top = new Ext.FormPanel({
labelWidth: 70,
frame:true,
title: '系统设置',
bodyStyle: 'padding:5px 5px 0',
style: 'margin: 10px',
width: 700,
defaults: {width: 230},
defaultType: 'textfield',
items: [{
fieldLabel: '标 题',
name: 'title'
},{
fieldLabel: '短标题',
name: 'shorttitle'
},{
xtype:'combo',
store: new Ext.data.SimpleStore({
fields: ["retrunValue", "displayText"],
data: [[0,'无']]
}),
valueField :"retrunValue",
displayField: "displayText",
mode: 'local',
editable: false,
forceSelection: true,
triggerAction: 'all',
hiddenName:'category',
fieldLabel: '分 类',
emptyText:'选择分类',
name: 'category'
},{
fieldLabel: '作 者',
name: 'author'
},{
fieldLabel: '来 源',
name: 'source'
},{
xtype:'textarea',
fieldLabel: '摘 要',
id:'brief',
name: 'brief'
},{
xtype: 'htmleditor',
fieldLabel: '内 容',
width: 500,
name: 'content',
fontFamilies: ['宋体','黑体']
},{
xtype:'combo',
store: new Ext.data.SimpleStore({
fields: ["retrunValue", "displayText"],
data: [[1,'显示'],[0,'隐藏']]
}),
valueField :"retrunValue",
displayField: "displayText",
mode: 'local',
editable: false,
forceSelection: true,
triggerAction: 'all',
hiddenName:'status',
fieldLabel: '状 态',
emptyText:'选 择',
name: 'status',
value: 0
},{
xtype:'hidden',
name: 'id',
id:'id',
value: ''
}],
buttons: [{
text: '确定',
handler:function(){
if(top.form.isValid()){
top.form.doAction('submit',{
url:'index2.php?model=news&action=save',
method:'post',
params:'',
success:function(form,action){
Ext.Msg.alert('操作','保存成功!');
},
failure:function(){
Ext.Msg.alert('操作','服务器出现错误请稍后再试!');
}
});
}
}
},{
text: '重置',
handler:function(){
Ext.Msg.alert('操作','服务器出现错误请稍后再试!');
top.form.reset();
}
}]
});
top.render(document.body);
});
</script>
</body>
</html>