Extjs Gridpanel 동적 로드

8175 단어 gridPanel
colMArray_ljdj=[smQd,
                {header : /*"      "*/"  ",    dataIndex : "dxjgdm",    width : 100},
                {header : /*    */"  ",    dataIndex : "khmc",    width : 100},
                {header : /*"    "*/"  ",    dataIndex : "jyje",    width : 100, renderer:jyje_format, align:"right"},
                {header : /*"    "*/"    ",    dataIndex : "jyrq",    width : 100},
                   {header : /*"    "*/"    ",    dataIndex : "jysj",    width : 100}, 
                   {header : "    ",    dataIndex : "yhdh",    width : 100},
                   {header : /*      */"    ",    dataIndex : "khtzzt",    width : 100},
                   {header : /*      */"      ",    dataIndex : "khlxzt",    width : 100},
                   {header : /*      */"    ",    dataIndex : "xgdjzt",    width : 100},
                   {header : "    ",dataIndex: 'zxdj', width : 80, renderer:zxdj_btn},
                   {header : /*      */"    ",    dataIndex : "xyqyzt",    width : 100},
                   {header : "    ",    dataIndex : "kkzt",    width : 100},
                   {header : "  ",dataIndex: 'kk', width : 80, renderer:kk_btn}];
function zxdj_btn(value, metaData, record, rowIndex, colIndex, store){
    var lsh = record.data['lsh'];
    var jyje_arr = record.data['jyje'].split(",");
    var jyje = "";
    for(var j = 0; j< jyje_arr.length; j++){
        jyje += jyje_arr[j];
    }
    jyje = parseFloat(jyje);
    if(((record.data['ywdm'] == '901')&&(record.data['xgdjzt'].split("-")[0] == 0))||((record.data['ywdm'] == '902')&&(record.data['khlxzt'].split("-")[0] == 1) && (record.data['xgdjzt'].split("-")[0] == 0))){
        return "<div align='center'><button style='cursor:hand' onclick='ybdj(\""+lsh+"\",\""+jyje+"\")'><font size='1'>  </font></button></div>";
    }else if((record.data['ywdm'] == '902')&&(record.data['xgdjzt'].split("-")[0] == 2)&&(record.data['kkzt'].split("-")[0] == 0)){
        return "<div align='center'><button style='cursor:hand;' onclick='qxdj(\""+lsh+"\")'><font size='1'>    </font></button></div>";
    }else{
        return "<div align='center'><button style='cursor:hand;' disabled onclick=''><font size='1'>  </font></button></div>";
    }
    /*
    if((record.data['xgdjzt'].split("-")[0] == 2)||(record.data['khlxzt'].split("-")[0] == 0)){
        return "<div align='center'><button style='cursor:hand;' disabled onclick='ybdj(\""+lsh+"\")'><font size='1'>  </font></button></div>";
    }else{
        return "<div align='center'><button style='cursor:hand' onclick=''><font size='1'>  </font></button></div>";
    }*/
}

function kk_btn(value, metaData, record, rowIndex, colIndex, store){
    var lsh = record.data['lsh'];
    if((record.data['xgdjzt'].split("-")[0] == 2)&&(record.data['kkzt'].split("-")[0] == 0)){
        return "<div align='center'><button style='cursor:hand' onclick='kk(\""+lsh+"\")'><font size='1'>  </font></button></div>"
    }else{
        return "<div align='center'><button style='cursor:hand' disabled onclick=''><font size='1'>  </font></button></div>"
    }
}

function jyje_format(value, metaData, record, rowIndex, colIndex, store){
    if(value != null && value != ""){
        return rendererZhMoney(value);
    }else{
        return value;
    }
}

좋은 웹페이지 즐겨찾기