编程语言


Extjs NumberField后面加单位实现思路

网络编程 Extjs NumberField后面加单位实现思路 06-21
UnitText.js
=======================

// 输入框textfield后面放字unitText定义:
Ext.override(Ext.form.TextField, {
unitText : '',
onRender : function(ct, position) {
Ext.form.TextField.superclass.onRender.call(this,ct, position);

if (this.unitText != ''){
this.unitEl =ct.createChild({
tag: 'div',
html: this.unitText this.unitEl.addClass('x-form-unit'); this.width =this.width
-(this.unitText.replace(/[^x00-xff]/g, "xx").length * 6 +2); this.alignErrorIcon= function() {
this.errorIcon.alignTo(this.unitEl,'tl-tr', [2, 0]); }});

将UnitText.js放入到jsp文件中,加上css样式,如下:

<style>
.x-form-unit{
height:22px;
line-height:22px;
padding-left:2px;
display:inline-block;
display:inline; </style>
<script type="text/javascript"src="UnitText.js"></script>

这样就可以用了,使用方法如下:

var jine = new Ext.form.NumberField({
id: 'je',
fieldLabel: '金额',
allowDecimals: true, // 允许小数点?
allowNegative: false, // 允许负数?
width: 100,
style: 'text-align:right',
unitText: ' 元'
});

关于extjs4如何获取grid修改后的数据的问题
下面是API的描述。可以获取各种值。e:ObjectAnediteventwiththefollowingproperties:grid-Thegridrecord-Therecordthatwaseditedfield-Thefieldnamethatwaseditedvalue-ThevaluebeingsetoriginalValu

extjs两个tbar问题探讨
版本:extjs3.4接触过extjs的同志们都知道每个panel都有一个tbar(topbar上面工具栏),bbar(bottombar底部工具栏)大家做查询页面,一般都是啥样子的?最基本的是

Extjs3.0 checkboxGroup 动态添加item实现思路
Extjs3.0中的CheckboxGroup默认不能动态添加item。虽然它继承了Ext.form.Field,但是却类似于容器。CheckboxGroup配置中的items处理生成一个对应的panel,该处理过程


编辑:编程语言

标签:工具栏,的是,都是,都有,动态