异步加载EasyUI编辑控件后,样式无效,JS 添加样式也无效

heiheidan 2015-06-17 11:11:53
基本代码如下
//页面初始化函数
$(function () {
var moduleNO = $("#HFModuleNO").val();
//获取编辑页面脚本
$.ajax({
type: "get",
url: "UI_SinglePageScript.aspx",
data: "moduleNO=" + moduleNO + "&typeNO=2&subID=" + Math.random(),
async: false, //同步接受数据
success: function (msg) { $("#DIVDataEdit").html(msg); }
});
$('#DateType').attr('class', 'easyui-datebox');
})
返回的编辑编辑页面代码
<div><label>日期類型</label><input id="DateType" type="text" name="TextBox" class="easyui-datebox" /></div>

代码执行完成后,日期控件没有任何效果,请各位大侠指点
...全文
1055 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hold6on 2017-11-06
  • 打赏
  • 举报
回复
楼主 ,你怎么解决的啊,求告知
所为 2016-01-22
  • 打赏
  • 举报
回复
怎么解决的?
heiheidan 2015-06-18
  • 打赏
  • 举报
回复
问题已解决,非常感谢。
heiheidan 2015-06-17
  • 打赏
  • 举报
回复
DIVDataEdit 是个<div></div>标签,在页面文本中,用来显示编辑脚本的地方
蝶恋花雨 2015-06-17
  • 打赏
  • 举报
回复
DIVDataEdit 这个ID在哪怎么没看见? $("#DIVDataEdit").html(msg); =》 $("#DateType").html(msg); 不是给input 赋值吗?
  • 打赏
  • 举报
回复
或者只解析DateType的父类id
$.parser.parse('#id');//id为DateType的父类id
  • 打赏
  • 举报
回复
$('#DateType').attr('class', 'easyui-datebox');
$.parser.parse();//加上

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧