Ext4工具类使用

在Ext4中的各种类型提供的静态方法工具类, 比如查询 String 中是否包含另外一个 String

查询  API  看到Ext.String  类,

 

A collection of useful static methods to deal with strings.

 

 

其方法描述为:

 

endsWith( s, start, [ignoreCase] )

Checks if a string ends with a substring

Parameters

  • s : String

    The original string

  • start : String

    The substring to check

  • ignoreCase : Boolean (optional)

    True to ignore the case in the comparison

    Defaults to: false

     

     

使用:

if(Ext.String.endsWith(combo.getValue(),"***年")){
  alert("OK");
}

//返回 true

 

Ext日期的格式化

 

	function formatDate(value){
		var val = null;
		if(window.addEventListener){
			val = Ext.util.Format.date(value,'Y-m-d');
		}else{
			if(Ext.isDate(value)){
				var valDate = Ext.Date.format(value, "Y-m-d");
				val = valDate.toString();
			}else{
				val = value;
			}
		}
		return val;
	}

 

得到了日期, 但是传到后台格式不好转化, 进行转换

    //将时间转化为 2011-08-20 00:00:00 格式 
    //解决Ext4的formPanel通过grid的store查询问题 2012.2.22 jzr 
    function dateFormat(value){ 
        if(null != value){ 
            return Ext.Date.format(new Date(value),'Y-m-d H:i:s'); 
        }else{ 
            return null; 
        } 
    } 

 

 

今天,使用for居然失败了,

var ids = bigsuitidxmap[record.data.bigSuitNo];

for(index in ids),得到的index不对, 想到使用Ext 自带的each

 

var ids = bigsuitidxmap[record.data.bigSuitNo];
		Ext.Array.each(ids, function(rdx, index, countriesItSelf) {
			airportGrid.getSelectionModel().deselect(rdx,true,false);
		});

 

成功取得。

 

FF

可以通过 console.log(XXX) 察看结果

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值