Ext Ext.util.Formatでよく使われる関数の紹介
5037 ワード
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
request.setAttribute("base", request.getContextPath());
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>decode encode </title>
<link rel="stylesheet" type="text/css" href="${base}/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="${base}/ext/ext-base.js"></script>
<script type="text/javascript" src="${base}/ext/ext-all.js"></script>
<script type="text/javascript" src="${base}/ext/ext-lang-zh_CN.js"></script><!-- -->
<script type="text/javascript">
function ready(){
//Ext.util.Format.capitalize( )
var str="abcdefghigklmn";
var after=Ext.util.Format.capitalize(str);// ,
Ext.Msg.alert("",after);// Abcdefghigklmn
}
Ext.onReady(ready) ;// ,onReady
</script>
</head>
<body>
</body>
</html>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
request.setAttribute("base", request.getContextPath());
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>decode encode </title>
<link rel="stylesheet" type="text/css" href="${base}/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="${base}/ext/ext-base.js"></script>
<script type="text/javascript" src="${base}/ext/ext-all.js"></script>
<script type="text/javascript" src="${base}/ext/ext-lang-zh_CN.js"></script><!-- -->
<script type="text/javascript">
function ready(){
//Ext.util.Format.ellipsis( , ); , ,
,
var str="abcdefghigklmn";
var after=Ext.util.Format.ellipsis(str,8);
Ext.Msg.alert("",after);// abcde...
}
Ext.onReady(ready) ;// ,onReady
</script>
</head>
<body>
</body>
</html>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
request.setAttribute("base", request.getContextPath());
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>decode encode </title>
<link rel="stylesheet" type="text/css" href="${base}/ext/resources/css/ext-all.css" />
<script type="text/javascript" src="${base}/ext/ext-base.js"></script>
<script type="text/javascript" src="${base}/ext/ext-all.js"></script>
<script type="text/javascript" src="${base}/ext/ext-lang-zh_CN.js"></script><!-- -->
<script type="text/javascript">
function ready(){
//Ext.util.Format.uppercase( ),
var str="abcdefghigklmn";
var after=Ext.util.Format.uppercase(str);
Ext.Msg.alert("",after);// ABCDEFGHIGKLMN
}
Ext.onReady(ready) ;// ,onReady
</script>
</head>
<body>
</body>
</html>
その他の例:
Ext.util.Format.Powercase(パラメータ);
Ext.util.Format.substr(パラメータ、インデックス位置、切り取り文字列の長さ);
Ext.util.Format.usMoney("1000");//文字列をドルに変換します.ここの1000は例にすぎません.
Ext.util.Format.trim(" 1000 ");//スペース関数を削除
Ext.util.Format.fileSize("1024");//バイトを表すデータ値をファイルサイズに変換する文字列