var baseUrl = web_app.name + '/bpm/procInst';
var maingridManager;

$(function () {
    UICtrl.setSearchAreaToggle(maingridManager);
})

function reloadGrid() {
    var params = $("#queryMainForm").formToJSON();
    UICtrl.gridSearch(maingridManager, params);
}

function query(obj) {
    var param = $(obj).formToJSON();
    UICtrl.gridSearch(maingridManager, param);
}

function resetForm(obj) {
    $(obj).formClean();
}

function showViewer() {
    var row = DataUtil.getSelectedRow(maingridManager);
    if (!row) {
        return;
    }
    UICtrl.addTabItem({
        tabid: 'procInstViewer'+row.id,
        text: '流程实例['+ row.name +']',
        url: web_app.name + '/bpm/procInst/forwardViewer.do?id=' + row.id
    });
}
