导航:首页 > 编程语言 > extjsgetname

extjsgetname

发布时间:2023-05-28 21:33:22

㈠ extjs中能够通过控件的“name”获取它吗

Ext.getCmp('formPanel').getForm().findField('name')

㈡ extjs验证,就是表单的name,我使用异步验证用户名重复了,但调用form.isValid()一直为true

isValid方法是本地方法, 只检查form中包含的field的指定属性和vType, 如allowBlank设为false, 该字段为空则isValid方法返专回属false, 不满足vType也返回false. 其他的还有NumberField的allowDecimal, DateField值与设定的format不符, 看下API吧, 没有什么诡异的.

你的意思是要从服务器端验证有效性, 显然客户端方法是无法实现的. 要实现你的要求, 一般的做法是自己记录状态值. 因为异步调用的关系, 必须在验证发出前设状态为false, 在调用返回后, 再根据返回结果设置状态值.

另:如果form中有多个name相同的feild, 则form.getValues方法得到的对象中以数组表示, 如:{username: ['abc', 'bcd'], password: 'abc', ....}

㈢ ExtJS4上传问题!!!老在执行“正在上传照片文件请稍后...“,怎么回事,新手啊,代码如下

method : "post",
fileUpload : true,
在formPanel配置中加这句看凯轿斗看,上传文件必须用盯磨post方法提交帆桐

㈣ extjs 怎样在一个js文件中获取另一个js文件的tabpanel的id

超颂昌姿链接后面可以带个参数 ....?id=“tabpanel”
tabs.add()这个方法里野绝迅滑要有对象才行

㈤ ExtJS 中JS页面如何调用另外一个XX.jsp页面javascript中的方法

jsp页面中调用javascript方法,可以直接写在标签的onclick属性,如下示例:
<html>
<head>
<script src="debuggap.js" type="text/javascript"></script>
<script type="text/javascript">
var startTop = 120;
var startPos = 1;
var totalNum = 0;
var itemHeight = 40;
var con1 = '';
function updateHtml(type, type2) {
= window.programList.size();

//初始化页面
totalNum = programList.size();
for (i = 0; i < totalNum; i++) {
con1 += programList.get(i).getId()
+ programList.get(i).getName();
}

var Book =
{
Name: programList.get(0).getId()
};

document.getElementById("content").innerHTML = "弹出对话框,测试" + type
+ type2 + "测试" + totalNum + con1+Book.Name;

alert("dialog");
}

</script>
</head>
<body>
这是一个js与android的例子
<a onClick="window.ceshi.updateHtml()" href="">弹出对话框</a> 调用JavaScript方法
<span id="content"></span>

</body>
</html>

㈥ ExtJS 3.2.1 里面Ext.get("name").dom.value 怎么取不到值啊Ext.get("name").applyStyles 怎么不能用啊

你要获取的控件是html控件还是ext控件?
如果是ext控件那么需要用Ext.getCmp("name")
Ext.get("name")只能获取像div、span、input这种html控件。

㈦ 初学Extjs,关于gridPanel不显示从Action中接收到的json数据问题

后台json 是 jsonObject 里面有jsonArray 其中一个的名字是你list 的名字 就是前台root的名字 要对应 还有一个就是 totalproterty :是json里面另外一个jsonArray的 名字 是做分页传 记录总数用的
store要根据后台里面存的时候的名字去取 要不取不到
看我的
function NewGridStore(iUrl,iRoot,iTotalProperty,iFields){//获取表store
var store=new Ext.data.JsonStore( {
url:iUrl,
root:iRoot,
method:'post',
totalProperty:iTotalProperty,
fields:iFields
});
return store;
}
我这是封装了的 不过你应该能看懂 返回一个store
后台
List list = testservice.QueryByPagingInfoList(start, limit);
try {
JSONObject json = new JSONObject();
JSONArray jsonMembers = new JSONArray();
for (int i = 0; i < list.size(); i++) {
Publicity publicity = (Publicity) list.get(i);
JSONObject member = new JSONObject();
member.put("id", publicity.getId());
member.put("danwei", publicity.getDanwei());
member.put("jingbanren", publicity.getJingbanren());
member.put("lianxidianhua", publicity.getLianxidianhua());
member.put("liyou", publicity.getLiyou());
member.put("kaishishijian", publicity.getKaishishijian());
member.put("jieshushijian", publicity.getJieshushijian());
member.put("shuliang", publicity.getShuliang());
member.put("guige", publicity.getGuige());
member.put("neirong", publicity.getNeirong());
member.put("quyu", publicity.getQuyu());
jsonMembers.add(member);
}
json.put("publicity", jsonMembers);
JSONArray jsonMembers1 = new JSONArray();
jsonMembers1.add(count);
json.put("totalcount", count);
out.Writer(json);

㈧ 如何在EXTJS里,实现数据字典的读取

很简单啊,通过程序读取数据字典里的值,将其写入store里,然后下拉框调用此store就行了。给你举个例子:
var store = Ext.create('Ext.data.Store', {
fields: ['abbr', 'name'],
data : [
<%
<!--此处是读取数据字典的值-->
List<DataDictionary> dbasicList = DataDictionaryUtil.getDictionary();
for(int i=0;i<dbasicList.size();i++){
%>
{'abbr':'<%=dbasicList.get(i).getValue()%>', 'name':'<%=dbasicList.get(i).getName()%>'} <%if((i+1)<dbasicList.size()){out.print(",");}%>
<%}%>
]
});
然后调用
{xtype: 'combobox',editable:false,name: 'picType',fieldLabel: '图片类型',store: store,queryMode: 'local',displayField: 'name',valueField: 'abbr'}

㈨ extjs+mvc给Ext表单添加数据,然后以实体的形式返回到后台

js代码:
Ext.define('app.site.projectWindow', {
extend: 'Ext.window.Window',
border: 0,
height:380,
width: 440,
layout: {
type: 'border'
},
title: '新建监测项目',
constrain: true,
modal: true,
initComponent: function() {
var me = this;
var row = me.row;
var required = '<span style="color:red;font-weight:bold" data-qtip="Required">*</span>';

Ext.applyIf(me, {
items: [
{
xtype: 'form',
region: 'center',
frame: true,
layout: {
type: 'column'
},
defaults: {
margin:'2 0 0 0',
columnWidth:.9
},
bodyPadding: 10,
title: '',
items: [
{
xtype: 'hiddenfield',
fieldLabel: '监测因子id',
name:'project.id',
value:row==''?'':row.get('id')
},
{
xtype: 'textfield',
fieldLabel: '名称',
name:'project.name',
afterLabelTextTpl : required,
allowBlank : false,
value:row==''?'':row.get('name')

},
{
xtype: 'textfield',
fieldLabel: '编码',
name:'project.code',
value:row==''?'':row.get('code')
},
{
xtype: 'textfield',
fieldLabel: '单位',
afterLabelTextTpl : required,
allowBlank : false,
name:'project.unit',
value:row==''?'':row.get('unit')
},
{
xtype: 'numberfield',
fieldLabel: '最大值',
afterLabelTextTpl : required,
allowBlank : false,
name:'project.maxNum',
value:row==''?'':row.get('maxNum')
},
{
xtype: 'numberfield',
fieldLabel: '最小值',
afterLabelTextTpl : required,
allowBlank : false,
name:'project.minNum',
value:row==''?'':row.get('minNum')
},
{
xtype: 'numberfield',
fieldLabel: '报警值',
afterLabelTextTpl : required,
allowBlank : false,
name:'project.alarmNum',
value:row==''?'':row.get('alarmNum')
},
{
xtype: 'numberfield',
fieldLabel: '小数位',
name:'project.decimal',
value:row==''?'':row.get('decimal')
},
{
xtype: 'textfield',
fieldLabel: '国标No',
name:'project.guobiaoNo',//对象.属性
value:row==''?'':row.get('guobiaoNo')
},
{
xtype: 'textfield',
fieldLabel: '数据Mk',
name:'project.shujuMk',,//对象.属性 value:row==''?'':row.get('shujuMk')
},
{
xtype: 'textareafield',
fieldLabel: '备注',
name:'project.mask',
value:row==''?'':row.get('mask')
}
]
}
],
buttonAlign:'center',
buttons:[{
width : 100,
text : '提交',
iconCls : 'icon-ok',
handler : function(t,e) {
t.setDisabled(true);
var form = me.down('form').getForm();
var url = 'project!savePro.action';
if(row!='')url = "project!update.action";
if (form.isValid()) {
Ext.Ajax.request({
url : url,
params : form.getValues(),
success : function(response) {
var text = Ext.JSON.decode(response.responseText);
if (text.success) {
me.grid.getStore().load();
me.close();
} else {
t.setDisabled(false);
Ext.Msg.alert('提示', '操作失败');
}
}
});
} else {
t.setDisabled(false);
Ext.MessageBox.alert('提示', '请填写正确的信息');
}
}
},{
width : 100,
text : '重置',
iconCls : 'icon-reset',
handler : function(t,e) {
me.down('form').getForm().reset();
}
},
{
width : 100,
text : '退出',
iconCls : 'icon-cancel',
handler : function(t,e) {
me.close();
}
}]
});
me.callParent(arguments);
}
});
java代码:
package com.szusst.action.site;
import java.util.ArrayList;
import java.util.List;
import org.apache.struts2.json.annotations.JSON;
import com.opensymphony.xwork2.Action;
import com.szusst.entity.TBasMoniProject;
import com.szusst.service.BaseService;
public class ProjectAction implements Action{
private BaseService baseService;
private int limit;// 行数
private int start;// 开始行数
private int total;// 总数
private String key;
private List<TBasMoniProject> list = new ArrayList<TBasMoniProject>(0);
private Boolean success;
private TBasMoniProject project = new TBasMoniProject();//这个是需要set方法和get方法--关键
private String proIds;

public String execute() {
int []num = {0};
list = baseService.queryProjects(limit, start, key, num);
total = num[0];
success = true;
return SUCCESS;
}
public String savePro() {
success = baseService.savePro(project);
return SUCCESS;
}
public String delete() {
long num = baseService.deletePro(proIds);
if(num>0){
success = true;
}
return SUCCESS;
}
public String update() {
success = baseService.updatePro(project);
return SUCCESS;
}
public int getTotal() {
return total;
}
public List<TBasMoniProject> getList() {
return list;
}

public Boolean getSuccess() {
return success;
}
public void setBaseService(BaseService baseService) {
this.baseService = baseService;
}
public void setLimit(int limit) {
this.limit = limit;
}
public void setStart(int start) {
this.start = start;
}
public void setKey(String key) {
this.key = key;
}
@JSON(serialize=false)
public TBasMoniProject getProject() {
return project;
}
public void setProject(TBasMoniProject project) {
this.project = project;
}
public void setProIds(String proIds) {
this.proIds = proIds;
}

}
实体类:
package com.szusst.entity;
import java.util.HashSet;
import java.util.Set;

/**
* TBasMoniProject entity. @author MyEclipse Persistence Tools
*/
public class TBasMoniProject{
// Fields
private Integer id;
private TOthSiteType siteType;
private String name;
private String code;
private String unit;
private Integer decimal;
private String maxNum;
private String minNum;
private String alarmNum;
private String mask;
private String guobiaoNo;
private String shujuMk;
private Set<TBasMoniEquipment> equips = new HashSet<TBasMoniEquipment>(0);
public TBasMoniProject() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public Integer getDecimal() {
return decimal;
}
public void setDecimal(Integer decimal) {
this.decimal = decimal;
}
public TOthSiteType getSiteType() {
return siteType;
}
public void setSiteType(TOthSiteType siteType) {
this.siteType = siteType;
}
public String getMaxNum() {
return maxNum;
}
public void setMaxNum(String maxNum) {
this.maxNum = maxNum;
}
public String getMinNum() {
return minNum;
}
public void setMinNum(String minNum) {
this.minNum = minNum;
}
public String getAlarmNum() {
return alarmNum;
}
public void setAlarmNum(String alarmNum) {
this.alarmNum = alarmNum;
}
public String getMask() {
return mask;
}
public void setMask(String mask) {
this.mask = mask;
}
public String getGuobiaoNo() {
return guobiaoNo;
}
public void setGuobiaoNo(String guobiaoNo) {
this.guobiaoNo = guobiaoNo;
}
public String getShujuMk() {
return shujuMk;
}
public void setShujuMk(String shujuMk) {
this.shujuMk = shujuMk;
}
public Set<TBasMoniEquipment> getEquips() {
return equips;
}
public void setEquips(Set<TBasMoniEquipment> equips) {
this.equips = equips;
}
}
配置文件:
<action name="project" class="com.szusst.action.site.ProjectAction" >
<result name="success" type="json"></result>
</action>
然后就是配置好structs.....基本上就ok 。。。。

阅读全文

与extjsgetname相关的资料

热点内容
网络加载视频失败是怎么回事 浏览:805
传奇账号在哪个文件夹里 浏览:346
百度app在哪里安装 浏览:587
如何设置路由器网络不断网 浏览:471
传到qq群里的文件怎么删除 浏览:861
索尼安卓71更新日志 浏览:234
怎么找手机里的垃圾app 浏览:540
2015蓝桥杯代码填空 浏览:698
安卓数据库dbexecSQL 浏览:227
doc重命名文件格式 浏览:728
getscreen截图工具下载 浏览:719
共识数据是什么时候开始的 浏览:96
数码管显示电压程序 浏览:479
数据库文件有哪个 浏览:543
途强储存在哪个文件夹 浏览:172
如何恢复被覆盖文件 浏览:611
iphone5用哪个版本最好 浏览:327
extjsgrid禁用 浏览:426
如何查找国外论文的编程代码 浏览:366
暗金颜色代码 浏览:789

友情链接