easyUi 頁面創建一個toolbar實例


1.定義toolbar方法

pagination : true,
pageSize : 10,
pageList : [ 5, 10, 15, 20, 50 ],
toolbar : toolbarFtt()

 

 

2.定義新增方法

function toolbarFtt() {
    if (top.checkRole([ 'LOCK_FORFEITRUE' ])) {
        return [ {
            text : '繳納保證金',
            iconCls : 'icon-add',
            handler : gridAdd
        } ]
    }
}

 

3.新增方法的具體實現

function gridAdd() {
    var dlg = $('#mydialog').dialog({
        title : '繳納保證金',
        left:"30%",
        top:"20%",
        buttons : [ {
            text : "確認支付",
            handler : function() {
                confirmSubmit();
            }
        }, {
            text : "關閉",
            handler : function() {
                dlg.dialog('close');
            }
        } ]
    });
    $('#myform').form('reset');
    getPayedWay();//支付方式處理
    getAgency();//查詢所有的市場機構id和名稱
    $('#mydialog').dialog('open'); // 打開窗口
}

 

4.

function confirmSubmit() {
    if($('#bailClass').combobox('getValue')==1){
        //默認選中第一個
        $('#agencyId').combobox('setValue',0);
    }
    if ($('#myform').form('validate')) {
        $.ajax({
            type : "POST",
            url : top.baseUrl + 'customer/bail/charge',
            data : $('#myform').serialize(),
            dataType : 'json',
            success : function(result) {
                $('#mydialog').dialog('close');
                $('#gridTable').datagrid('reload');
                $('#gridTable').datagrid('unselectAll');
                $.messager.show({
                    title : '提示信息!',
                    msg : '操作成功!'
                });
            },
            error : function(result) {
                
            }
        });

    }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM