easyUI class="easyui-numberbox" 重新加载无法显示的问题

本文介绍了一个用于编辑产品价格规则的界面,该界面允许用户设置折扣数和金额,并通过Ajax请求填充表单字段。展示了如何使用jQuery来操作元素并设置输入框的值。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<li class="item">
<label class="item_title">折扣数:</label>
<div><input type="text" id="discount" name="discount" style="height:22px;" value="" class="easyui-numberbox" precision="2" max="0.99" fix=""/></div>
</li>
<li class="item">
<label class="item_title">金额:</label>
<div><input type="text" id="sum" name="sum" style="height:22px;" value="" [color=darkblue]class="easyui-numberbox"[/color] precision="2" min="0" fix=""/></div>
</li>


if(priceruleId==''){
$('#priceruleForm').datagrid('unselectAll');
}else{
$.ajax({
'url': basePath+"product/pricerule/show.action?id="+priceruleId,
'type': 'post',
'dataType: 'json',
'success': function(data){

var json =data['rows'][0];
$('#priceruleForm input').each(function(){
$(this).attr('value', json[this.name]);
});
strategy.select(json.strategy);
state.select(json.state);
type.select(json.type);

[color=red]$('#discount').numberbox('setValue',json.discount);
$('#sum').numberbox('setValue',json.sum);[/color]


$('#endTime').datebox('setValue',json.endTime);
$('#startTime').datebox('setValue',json.startTime);

}
});

}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值