收藏本站 收藏本站
积木网首页 - 软件测试 - 常用手册 - 站长工具 - 技术社区
首页 > JavaScript > extjs > 正文

首页 - PHP - 数据库 - 操作系统 - 游戏开发 - JS - Android - MySql - Redis - MongoDB - Win8 - Shell编程 - DOS命令 - jQuery - CSS样式 - Python - Perl

Access - Oracle - DB2 - SQLServer - MsSql2008 - MsSql2005 - Sqlite - PostgreSQL - node.js - extjs - JavaScript vbs - Powershell - Ruby

Extjs NumberField后面加单位实现思路

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,该处理过程

本周排行

更新排行

强悍的草根IT技术社区,这里应该有您想要的!
Copyright © 2010 Gimoo.Net. All Rights Rreserved  京ICP备05050695号