2019独角兽企业重金招聘Python工程师标准>>>
例子:方法abc(232,0255);
传给方法abc的参数是0255
但是在方法里就变成255了,前面的0没有了
主要的问题就是 当参数含有0的时候,如果没有对它进行处理,自动会去0, 可能js认为其是一个整数吧。
$(function(){
if(document.getElementById('idAposInfo')){
$('#idAposInfo').datagrid({
iconCls:'icon-save',
fit:true,
nowrap: false,
striped: true,
collapsible:true,
url:'listAposInfo.do',
sortName: 'KEYID',
sortOrder: 'desc',
remoteSort: false,
idField:'KEYID',
pageSize:20,
pagination:true,
rownumbers:true,
frozenColumns:[[
{field:'ck',checkbox:true},
{field:'FIELDS',title:'FIELDS',hidden:true},
{title:'KEYID',field:'KEYID',hidden:true}
]],
columns:[[
{title:'<bean:message key="ad.table.terminalNumber" bundle="common"/>',field:'APOS_ID',align:'center',width:100,sortable:true},//终端编号
{title:'<bean:message key="apos.table.manufacturerNo" bundle="common"/>',field:'F_NAME',align:'center',width:100,sortable:true},//厂商编号
{title:'<bean:message key="plan.table.model" bundle="common"/>',field:'MID_NAME',align:'center',width:100,sortable:true},//终端型号
{title:'<bean:message key="ad.table.hardwareSerialNumber" bundle="common"/>',field:'SERIAL_NO',align:'center',width:100,sortable:true},//硬件序列号
{title:'<bean:message key="ad.add.merchantNo" bundle="common"/>',field:'MERCH_ID',align:'center',width:120,sortable:true},//商户号
{title:'<bean:message key="ad.add.terminalNumber" bundle="common"/>',field:'TERM_ID',align:'center',width:90,sortable:true},//终端号
{title:'产品类型',field:'MID_TYPE',align:'center',width:100,sortable:true,
formatter:function(value,rowData,rowIndex){
if(value=="1"){
return LandiJS.ModelInfo.MidType_smart
}
else if(value=="2"){
return LandiJS.ModelInfo.MidType_common
} else {
return LandiJS.ModelInfo.MidType_other
}
}
},
{title:'<bean:message key="ad.table.layingAddress" bundle="common"/>',field:'ADDRESS',align:'center',width:100,sortable:true},//布放地址
{title:'<bean:message key="apos.table.lastPollTime" bundle="common"/>',field:'LAST_POLL_TIME',align:'center',width:100,sortable:true},//上次轮询时间
// {title:'所属区域',field:'AREA_ID',align:'center',width:100,sortable:true,hidden:true},
// {title:'所属区域',field:'AREA_NAME',align:'center',width:100,sortable:true
// ,
// formatter:function(value,rowData,rowIndex){
// if(value==null){
// return '<button value="选择区域" οnclick="selectArea('"+rowData.APOS_ID+"');">选择区域</button>';
// }else{
// return '<button value="'+value+'" οnclick="selectArea('"+rowData.APOS_ID+"');">'+value+'</button>';
// }
// }
// },
// {title:'终端状态',field:'FLAG',align:'center',width:100,sortable:true,
// formatter:function(value,rowData,rowIndex) {
// if(value=='0') {
// return '未用或者删除';
// }else if (value =='1'){
// return '在用';
// }else{
// return '未定义';
// }
// }
//
//
// },
// {title:'上送硬件信息',field:'UP_DEV_INFO',align:'center',width:100,sortable:true},
// {title:'参数个性化标志',field:'PARAM_FLAG',align:'center',width:100,sortable:true,
// formatter:function(value,rowData,rowIndex) {
// if(value=='0') {
// return '使用机构参数';
// }else if (value =='1'){
// return '自身性化参数';
// }else{
// return '未定义';
// }
// }
//
// },
{title:'<bean:message key="apos.table.screenBootTime" bundle="common"/>',field:'BOOTTIME',align:'center',width:100,sortable:true},//屏开机时间
{title:'<bean:message key="apos.table.screenOffTime" bundle="common"/>',field:'SHUTDOWN',align:'center',width:100,sortable:true},//屏关机时间
{title:'<bean:message key="reg.title" bundle="common"/>',field:'REG_NAME',align:'center',width:100,sortable:true},//分支机构
{title:'<bean:message key="reg.table.descTxt" bundle="common"/>',field:'MEMO',align:'center',width:100,sortable:true},//备注
{title:'<bean:message key="plan.table.lookUp" bundle="common"/>',field:'xx',align:'center',width:70,sortable:true,//查看
formatter:function(value,rowData,rowIndex) {
var id = rowData.APOS_ID;
//id=base64_encode(id);
return '<input type="button" class="btn_grid" value='+'<bean:message key="apos.table.details" bundle="common"/>' +' οnclick="doView(''+id+'')" />';//明细
}
}
]]
//,
//toolbar:[{
// id:'btnChangeStra',
// text:'选择区域',
// iconCls:'icon-ok',
// handler:function(){
// changeArea();
// }
// }]
});
$(".import_toolbar").attr('disabled', true);
$(".export_toolbar").attr('disabled', true);
}
原先红色部分的代码是这样的
{title:'<bean:message key="plan.table.lookUp" bundle="common"/>',field:'xx',align:'center',width:70,sortable:true,//查看
formatter:function(value,rowData,rowIndex) {
var id = rowData.APOS_ID;
//id=base64_encode(id);
return '<input type="button" class="btn_grid" value='+'<bean:message key="apos.table.details" bundle="common"/>' +' οnclick="doView('+id+')" />';//明细
}
没有用引号包住,所以造成数据丢失,搞了半天是这样原因。mark一下
转载于:https://my.oschina.net/u/228832/blog/533542
最后
以上就是潇洒白云最近收集整理的关于js 参数带0丢失的问题的全部内容,更多相关js内容请搜索靠谱客的其他文章。
发表评论 取消回复