js 參數帶0丟失的問題

例子:方法abc(232,0255);
傳給方法abc的參數是0255
可是在方法裏就變成255了,前面的0沒有了web

 

 

主要的問題就是 當參數含有0的時候,若是沒有對它進行處理,自動會去0, 可能js認爲其是一個整數吧。url

 

 

$(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="選擇區域" onclick="selectArea(\'"+rowData.APOS_ID+"\');">選擇區域</button>';
//     }else{
//      return '<button value="'+value+'" onclick="selectArea(\'"+rowData.APOS_ID+"\');">'+value+'</button>';
//     }
//    }
//   },spa

//   {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"/>' +' onclick="doView(\''+id+'\')" />';//明細
    }

   }
    ]]
    //,   
   //toolbar:[{
   //  id:'btnChangeStra',
   //  text:'選擇區域',
   //  iconCls:'icon-ok',
   //  handler:function(){    
   //   changeArea();
   //  }
   // }]
    
   });
   $(".import_toolbar").attr('disabled', true);
   $(".export_toolbar").attr('disabled', true);
  }code

原先紅色部分的代碼是這樣的orm

  {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"/>' +' onclick="doView('+id+')" />';//明細
    }

ip

沒有用引號包住,因此形成數據丟失,搞了半天是這樣緣由。mark一下rem

相關文章
相關標籤/搜索