easyui formatter 返回中无法应用numberbox样式

zzlu_suran 2016-01-26 08:45:33
想做一个输入的数字的验证,结果input中的样式并没有生效,请问为什么
<td field="sl">
<div style="height:auto;" class="datagrid-cell datagrid-cell-c8-sl">
<input name="sls" value="1" class="easyui-validatebox" data-options="required:true">
</div>
</td>

{
field : 'goodsId',
title : 'ID',
width : 150,
hidden : true,
formatter : function(value, row, index) {
return '<input name="goodsIds" type="hidden" value="'+row.goodsId+'" class=\'abc\'>'; }
}, {
field : 'goodsName',
title : '商品名称',
width : 100,
sortable : true
}, {
field : 'supplierId',
title : '供货商id',
width : 150,
hidden : true ,
formatter : function(value, row, index) {
return '<input name="supplierIds" type="hidden" value="'+row.supplierId+'" class=\'abc\'>'; }
}, {
field : 'supplierName',
title : '供货商',
width : 150,
sortable : true
}, {
field : 'sellPrice',
title : '销售价',
width : 150,
sortable : true,
formatter : function(value, row, index) {
return row.sellPrice+'<input name="sellPrices" type="hidden" value="'+row.sellPrice+'" class=\'abc\'>';
}
},{
field : 'goodsCode',
title : '分类码',
width : 150,
hidden : false
}, {
field : 'sl',
title : '数量',
width : 150,
formatter : function(value, row, index) {
return '<input name="sls" value=1 class="easyui-validatebox" data-options="required:true"/>';
}
} , {
field : 'action',
title : '动作',
width : 100,
formatter : function(value, row, index) {

return '<img onclick=cgrk_zdcgjh_addFrom_setGoods_deleteFun(\''+row.goodsId+'\') src=\'${pageContext.request.contextPath}/style/images/extjs_icons/cancel.png\'>';
}

}
...全文
375 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
$.parser.parse(); // parse all the page $.parser.parse('#cc'); // parse the specified node 页面加载完成后用上面的2选1
Go 旅城通票 2016-01-27
  • 打赏
  • 举报
回复
通过样式设置easyui插件的要在dom ready前加上样式,因为easyui在dom ready中首先会获取样式执行样式初始化,在dom ready后添加的不再有效,需要自己调用api进行初始化
$('选择器').validatebox({..配置.})

87,921

社区成员

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

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