版本生成|Ext form输入框后加文字说明

function games(){
    $result = $this->DB1->select('id,name')->get('game');
    echo '{"data":'.json_encode($result->result()).'}';
}
 
 
 
var libStore = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : 'VersionMgr/games'
}),
reader : new Ext.data.JsonReader({
root : "data"
}, [{name : "id"},
{name : "name"}])
});
// libStore = [['90','HUG'],['78','test']];
var libCombo = new Ext.form.ComboBox({
store : libStore,
emptyText : "请选择名称",
editable : false,
id : "game",
fieldLabel : "业务名称",
displayField : "name",
valueField : "id",
value : "",
width : 200,
triggerAction : "all",
allowBlank:false,
// mode : "local"
});
//编码选择
var encoding = new Ext.form.ComboBox({
store : [['GBK','GBK'],['UTF-8','UTF-8'],['GB2312','GB2312'],['UTF-16','UTF-16'],['windows-1252','windows-1252'],['ISO-8859-1','ISO-8859-1']],
emptyText : "请选择编码 ",
editable : false,
id : "encoding",
fieldLabel : "版本编码",
value : "",
width : 200,
triggerAction : "all",
allowBlank:false,
mode : "local"
});
var version_postWindow = new Ext.Window({
title: '版本生成',
width: 400,
height:200,
collapsible:true,
maximizable:true,
bodyStyle:'padding:5px 25px 0',
plain:true,
modal:true,
defaultType: 'textfield',
items: [{
xtype : 'form',
id:'version',
baseCls:"x-plain",
defaultType: 'textfield',
items:[
libCombo
,encoding
,{
fieldLabel: '版本号',
id: 'version_show',
regex : /^[0-9]+$/,
regexText:"只能输入数字!",
allowBlank : false,
sideText : '<font color=red>*如:20120328</font>'
},{
fieldLabel: '加密',
xtype : 'checkbox',
id: 'encryption'
}, {
fieldLabel: '支持URL编码',
labelSeparator: '',
xtype : 'checkbox',
id: 'urlencode'
}]
}],
buttons: [{
text: '生成',
handler: function(){
var panel = version_postWindow.findById('version');
var form = panel.getForm();
if(form.isValid()){
console.log(form.getFieldValues());//取得列值
// console.log(form.getValues());//取得文本值
}
}
},{
text: '关闭',
handler:function(){
version_postWindow.close();
}
}]
});
version_postWindow.show(this);
 
 
 
 
 
 
 
 
 
 
 
 
 
=========================
buttons: [{
text: '生成',
handler: function(){
console.log(this);
var panel = version_postWindow.findByType('form')[0];
var form = panel.getForm();
if(form.isValid()){
console.log(form.getValues());
}
//获取表单中某个控件的值
// this.getForm().findField('id').getValue()
//获取表单中所有控件的值
// console.log(this.getForm().getValues());
}
},{
text: '关闭',
handler:function(){
version_postWindow.close();
}
}]
});
 
=========================
var version_form = new Ext.form.FormPanel({
plain:true,
layout:"form",
labelWidth:80,
baseCls:"x-plain",
frame : true,
bodyStyle:'padding:5px 25px 0',
defaultType: 'textfield',
items: [libCombo
,encoding
,{
fieldLabel: '版本号',
name: 'version_show',
regex : /^[0-9]+$/,
regexText:"只能输入数字!",
allowBlank : false,
sideText : '<font color=red>*如:20120328</font>'
},{
fieldLabel: '加密',
xtype : 'checkbox',
name: 'encryption'
}, {
fieldLabel: '支持URL编码',
labelSeparator: '',
xtype : 'checkbox',
name: 'urlencode'
}
]
});
 
==============
{
fieldLabel: 'First Name',
name: 'first',
regex : /[\u4e00-\u9fa5]/, //正则表达式在/...../之间. [\u4e00-\u9fa5] : 只能输入中文.
regexText:"只能输入中文!", //正则表达式错误提示
allowBlank : false //此验证依然有效.不许为空.
}, new Ext.form.ComboBox({
transform:"encoding",//html中的id
width:80,//宽度
height:150
})
==================

Ext学习系列(9)-- Ext.data.HttpProxy

(2010-03-23 14:32:08)
标签:

ext

httpproxy

杂谈

分类: EXT

httpProxy是从object继承来的,事实上source中它和下面的Ext.data.MemoryProxy/Ext.data.ScriptTagProxy都继承于DataProxy
HttpProxy用于远程代理,而且服务端返回信息时必须指定Content-Type属性为"text/xml".

HttpProxy( Object conn )
构造一个HttpProxy对象,参数可以是一个类似于{url: 'foo.php'}这样的json对象,也可以是一个Ext.data.Connection对象,如果参数没有指定,将使用Ext.Ajax对象将被用于发起请求

getConnection() : Connection
得到当前连接对象

load( Object params, Ext.data.DataReader reader, Function callback, Object scope, Object arg ) : void
从配置的connection对象得到record数据块,并激发callback
params:        发起http请求时所要传递到服务端的参数
DataReader:    见DataReader
callback:    回叫方法,第一个参数为接收到的信息,第二个参数为arg,第三个是成功标志
scope:        范围
arg:        这儿的参数将会传递给回叫函数callback

 

例:

JS代码:

    Ext.onReady(function() {
            //数据
        var proxy1 = new Ext.data.HttpProxy({ url: "ExtData/Ext_Info3.aspx" });
         
            var reader1 = new Ext.data.JsonReader({
                root: "data",
                id: "id",
                totalProperty: "totalCount",
                successProperty: "success"
            },
                          [
                           { name: "id", mapping: "id" },
                           { name: "name", mapping: "name" },
                           { name: "sex", mapping: "sex" }
                          ]
    

转载于:https://www.cnblogs.com/holyes/archive/2012/06/26/29196c73c992bca3a55cf5e54a20248e.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值