日期:2014-05-17  浏览次数:20594 次

EXT.ENT MVC求个点击按钮弹出提示框的例子

------解决方案--------------------
怎么不好,效果比纯Js和Jquery的弹出效果帅多了


ShowWarning("该数据不存在,请刷新!");
//提示框
function ShowWarning(msg, callback) {
    Ext.MessageBox.show({
        title: '警告',
        msg: msg,
        modal: true,
        buttonText: {
            ok: "确定"
        },
        fn: callback,
        icon: Ext.Msg.WARNING
    });
}
Ext.get('Btn_SelectData');.on('click', function () {
                var url = '<%=Url.Action("对应的Action","对应的Controller")%>;
                win = openWindow('获取', 800, 720, url, true);
            });
//弹出页面效果也比较不错
function openWindow(title, width, height, url, automax) {
    var showPanel;
    var html = '<iframe src="' + url + '" width="100%" height="100%" ></iframe>';
    showPanel = new Ext.Panel({
        layout: 'fit',
        html: html
    });
    var newWindow = new Ext.Window({
        title: title,
        width: width,
        height: height,
        resizable: false,
        closable: true,
        draggable: true,
        layout: 'fit',
        modal: true,
        maximized: automax == undefined ? false : automax,
        maximizable: automax == true ? false : true,
        plain: true, // 表示为渲染window body的背景为透明的背景
        bodyStyle: 'padding:5px;',
        items: [showPanel]
    });
    newWindow.show();
    return newWindow;
}