收藏本站 收藏本站
积木网首页 - 软件测试 - 常用手册 - 站长工具 - 技术社区
首页 > 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的FieldSet的column列布局

以下是自己扩展的FieldSet:

ME.Base.FieldSet = Ext.extend(Ext.form.FieldSet, {
layout: 'column',
fieldSetItems: [],
autoScroll:false,
defaults: {
layout: 'form',
labelAlign: 'right',
labelWidth: 65,
columnWidth: .25,
defaults: {
anchor: '96%'
}
},
initComponent: function(){
var thisItems = new Array();
var itemsLen = this.fieldSetItems.length;
if(itemsLen > 0){
for (var i = 0; i < itemsLen; i++){
thisItems[thisItems.length] = {
items: this.fieldSetItems[i]
}
}
}
this.items = thisItems;
ME.Base.FieldSet.superclass.initComponent.call(this);
}
});


new ME.Base.FieldSet({
title: '基本信息',
autoHeight: true,
fieldSetItems: [{
xtype : 'textfield',
fieldLabel : "用户姓名",
name : 'USER_NAME'
}, {
xtype : 'textfield',
inputType : 'password',
fieldLabel : "用户密码",
name : 'PASSWORD'
}, {
xtype : 'textfield',
fieldLabel : "手机号码",
name : 'MOBILE'
}, {
xtype : 'textfield',
fieldLabel : "手机号码",
name : 'sss'
},{
xtype : 'textfield',
fieldLabel : "手机号码",
name : 'eee'
}]

  这样可以实现各个组件固定宽度,并随着Item个数的增长而自动延伸,保证整齐效果。
  可是,展现的结果总是会出现边框,每一个组件外面包裹的那个容器都有边框,非常难看。
  其实在列模式的每个容器配置项里加入
xtype: 'container',
autoEl: {},
  即可:

ME.Base.FieldSet = Ext.extend(Ext.form.FieldSet, {
layout: 'column',
fieldSetItems: [],
autoScroll:false,
defaults: {
xtype: 'container',
autoEl: {},
layout: 'form',
labelAlign: 'right',
labelWidth: 65,
columnWidth: .25,
defaults: {
anchor: '96%'
}
},
initComponent: function(){
var thisItems = new Array();
var itemsLen = this.fieldSetItems.length;
if(itemsLen > 0){
for (var i = 0; i < itemsLen; i++){
thisItems[thisItems.length] = {
items: this.fieldSetItems[i]
}
}
}
this.items = thisItems;
ME.Base.FieldSet.superclass.initComponent.call(this);
}
});

ExtJS Grid使用SimpleStore、多选框的方法
///referencepath="./vswd-ext_2.0.2.js"/Ext.onReady(function(){vardata=[[1,"wilson.fu",10],[2,"wilson.fu2",20],[3,"wilson.fu3",30]];varsqldata=newArray();for(vari=0;i10;i++){sqldata.push([i.toString(),

Exitjs获取DataView中图片文件名
1、前台scripttype="text/javascript"language="javascript"functionaa(){varselNode=this.DataView1.getSelectedNodes()[0];alert(selNode.id);}/script2、后台protectedvoidPage_Load(objectsender,EventArg

extJs 文本框后面加上说明文字+下拉列表选中值后触发事件
varshowForm;functionpanelShowForm(){showForm=null;showForm=newExt.FormPanel({renderTo:"showPanel",region:'north',border:false,bodyBorder:false,frame:true,waitMsgTarget:true,labelAlign:'right',id:"show

本周排行

更新排行

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