/*
텍스트 필드에 값을 붙여 넣은 경우 그 값에서 공백을
콤마로 치환하는 예제.
If you paste a value into a text field,
Example of replacing with a comma.
*/
<html>
<head>
</head>
<link rel="stylesheet" type="text/css" charset="UTF-8" href="./theme-gray-all.css" />
<style type="text/css">
</style>
<script type="text/javascript" charset="UTF-8" src="./ext-all.js"></script>
<body>
<script language='javascript' >
Ext.onReady(function(){
Ext.create('Ext.form.Panel', {
title: 'Contact Info',
width: 300,
bodyPadding: 10,
renderTo: Ext.getBody(),
items: [{
xtype: 'textfield',
name: 'name',
fieldLabel: 'Name',
allowBlank: false // requires a non-empty value
,
listeners: {
paste: {
element: 'inputEl',
fn: function(event, inputEl) {
setTimeout(function(){
var temp1 = ( inputEl.value ).replace(/ /g,",");
inputEl.value = temp1;
},0);
}
}
}
}, {
xtype: 'textfield',
name: 'email',
fieldLabel: 'Email Address',
vtype: 'email' // requires value to be a valid email address format
}]
});
});
'[.js][software]' 카테고리의 다른 글
[jqGrid] 특정 셀 마우스다운하고 다른 셀에 마우스 업하면 값 이동 (0) | 2017.09.11 |
---|---|
[jqGrid] simple Grid (local) (0) | 2017.09.08 |
[extJs] Mouse down the cell value and put it in the mouse-up cell (0) | 2017.09.08 |
[extJs] simple grid (editable) (0) | 2017.09.08 |
[extJs] simple gird (0) | 2017.09.08 |