我想把后台查到的数据返回到前台的文本框中 ,为什么这样取不到值?应该怎么取?
Ext.getCmp("参数名").setValue(Ext.util.JSON.decode(response.responseText).参数名);
Ext.getCmp("参数名").setValue(Ext.util.JSON.decode(response.responseText).参数名);
解决方案 »
- jquery删除行
- JSP页面导出到Office办公软件避免使用new ActiveXObject("Excel.Application")
- 看书上讲js继承的问题关于prototype的,里面有我写的例子,但有3个地方不明白,得到答案就结帖
- 火狐 TypeError: document.all is undefined 怎么解决?
- 我快疯了,弟兄们:“对象为空或不是函数”,简单代码中得极其郁闷问题,在线等救!!!!!
- 在网页嵌入的子页中能不能调用在其父页中定义的过程?
- EXTJS GRID的列不能全部显示
- 请指点---在线等
- 怎样固定一个div中的元素的位置
- 怎样用javascript隐藏一个打开的浏览器窗口(用window.open打开)
- js随机数
- iframe访问权限问题
Microsoft Internet Explorer
[object Object]
当然 form 的field的name 需和JSON的返回一样
Ext.getCmp("前台界面控件的id").setValue(Ext.util.JSON.decode(response.responseText).前台界面控件的id);
比如:手机号码
Ext.getCmp("serial_number").setValue(Ext.util.JSON.decode(response.responseText).SERIAL_NUMBER);
但是现在不调用接口了 为什么这样就取不到?
Ext.getCmp("").setValue("1");这样把值写死就可以得到
如果是undefined就没有了。
Ext.getCmp("serial_number").setValue(Ext.util.JSON.decode(response.responseText).SERIAL_NUMBER);直接替换成console.log(Ext.util.JSON.decode(response.responseText)),
然后该对象的属性什么的,都在里头
Response.End();aspx文件<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetFhxx.aspx.cs" Inherits="URL_Fhxx_GetFhxx" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>用这种方式AddFcqdForm.getForm().findField("fhqdh_add").setValue(response.responseText); 这样就可以直接赋值了