Grid 单元格点击跳转写法

Ext.create('Ext.grid.Panel',{
columnLines:true,
columns:[
{
                    header: '操作列',
                    dataIndex: 'V_GID',
                    sortable: true,
                    align: 'center',
                    width: 138,
                    renderer:_defDetail
                   //renderer:upFlagScop
                }
]
});
方法一:
function _defDetail(value, metaData, record, rowIndex, colIndex, store){

    metaData.style = "text-align:center";
    return '<a href="#" onclick="onClickDef(\''+value+'\')">'+详情+'</a>';
   

}
function onClickDef(){
    window.open(AppUrl + "page/No_4116/defView.html?V_GUID="
        + Ext.getStore("gridStore").getAt(index).get("V_ORDERGUID"),
        "", "dialogHeight:700px;dialogWidth:1100px");
}

方法二:

function upFlagScop(value, metaData, record, store) {
    metaData.style = "text-align:center";
    return '<a href="javascript:check(\'' + value + '\')">' + "变更" + '</a>';
}
function check(value) {
    Ext.Ajax.request({
        url: AppUrl + 'baseSet/updateScopeFlag',
        method: 'POST',
        async: false,
        params: {
            v_rule_scope: value
        },
        success: function (response) {
            var resp = Ext.decode(response.responseText);
            if (resp.ret == "Success") {
                alert(resp.ret_msg);

            } else {
                alert(resp.ret_msg);
            }
        }
    });
    window.location.reload();
}

猜你喜欢

转载自blog.csdn.net/woyizhizaizhaoni/article/details/90710977