megi非常方便的post Ajax异步请求方式(删除)!

1.Grid绑定数据的时候就绑定了删除的单击事件和对应的参数.

2.js调用removeCurrency()方法

 //删除常用币种的方法
    removeCurrency: function (itemID, rowIndex) {
        //删除确认信息 Are you sure to delete
        var delectConfirm = LangKey.AreYouSureToDelete;
        //弹出  确认     和    取消的提示框
        $.mDialog.confirm(delectConfirm, {
            callback: function () {  //callback 确认按钮的时候调用的删除方法
                //异步删除的url  移除的控制器
                var url = "/BD/Currency/RemoveBDCurrency";
                //参数
                var param = { MItemID: itemID };
                //回调函数
                var callback = function (msg) {
                    //是否正常
                    if (msg) {
                        //页面上根据rowIndex  移除该行
                        Megi.grid('#tbCurrency', "deleteRow", rowIndex);
                        //获取第一个行
                        CurrencyList.bindGrid(0);
                    }
                    else {
                        //弹出提醒,暂时不做
                    }

                };
                //异步提交
                Megi.Ajax.post(url, param, callback);
            }
        });
    },

posted on 2016-03-24 11:37  只为_更加优秀!  阅读(503)  评论(0编辑  收藏  举报

导航