jqGrid添加详细按钮,单击弹出窗体
代码如下:
@using WebMap.Framework.UI;
@using WebMap.Admin.Models;
@using WebMap.Core;
@using WebMap.Core.Infrastructure;
@{
ViewBag.Title = "贷款申请管理"; var defaultSettins = EngineContext.Current.Resolve<WebMap.Domain.Common.AdminAreaSettings>(); }
@section HeadSection {
<link rel="stylesheet" href="/Content/v1/jquery-ui.css" />
<link rel="stylesheet" href="/Content/v1/ui.jqgrid.css" />
<link rel="stylesheet" href="/Content/v1/datepicker.css" />
<link rel="stylesheet" href="/Content/v1/bootstrap-timepicker.css" />
<link rel="stylesheet" href="/Content/v1/daterangepicker.css" />
<link rel="stylesheet" href="/Content/v1/bootstrap-datetimepicker.css" /> }
<script src="http://www.webmap.com/Scripts/jquery-1.10.2.min.js"></script>
<script src="http://www.webmap.com/Scripts/ws.base.js"></script>
<div class="breadcrumbs" id="breadcrumbs">
<script type="text/javascript">
try {
ace.settings.check('breadcrumbs', 'fixed');
} catch (e) {
} </script>
<ul class="breadcrumb">
<li>
<i class="ace-icon fa fa-home home-icon"></i>
<a href="/Admin/">首页</a>
</li>
<li class="active">贷款申请</li>
</ul><!-- /.breadcrumb -->
</div>
<div class="page-content">
<div class="row">
<div class="col-xs-12">
<div class="form-group"> <div class="col-xs-2">
<input type="text" placeholder="输入您的查询:名称" class="form-control search-query" name="Name">
</div>
<div class="col-xs-1 wizard-actions">
<button class="btn btn-purple btn-sm wizard-actions" type="button">
<span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
查询
</button>
</div> </div>
<br />
<hr />
<table id="grid-table"></table>
<div id="grid-pager"></div>
<script type="text/javascript">
var $path_base = ".."; //in Ace demo this will be used for editurl parameter
</script>
</div>
</div>
</div>
<div id="load" style="width: 500px; height: 100px; position: absolute; top: 300px; left: 350px;"></div> @section FootSection { <script src="/Content/v1/js/date-time/bootstrap-datepicker.js"></script>
<script src="/Content/v1/js/date-time/bootstrap-timepicker.js"></script>
<script src="/Content/v1/js/date-time/moment.js"></script>
<script src="/Content/v1/js/date-time/daterangepicker.js"></script>
<script src="/Content/v1/js/date-time/bootstrap-datetimepicker.js"></script>
<script type="text/javascript">
// 审核
function AuditInfo(){
// 获取选中的id
$("#gbox_grid-table").find(":checkbox:checked").each(function(i){
var id = $(this).parent().parent().attr('id');
// 审核
$.ajax({
type: "POST",
url: "/Admin/BillLoanApply/AuditBillLoanApply",
data: "id="+id,
success: function(msg){
alert(msg);
}
});
}); // 刷新审核列表
location.reload();
}
function BillLoanDetails( id){
ws.base.showDialogNew("/Admin/BillLoanApplyDetail/List");
}
jQuery(function ($) { $(".wizard-actions :button").bind("click", function() {
var Name = $("input[name='Name']").val();
var postJson = {
PageSize: @(defaultSettins.DefaultGridPageSize),
CompanyName:Name,
}; jQuery("#grid-table").jqGrid('setGridParam', {
url: "/Admin/BillLoanApply/BillLoanApplyList",
postData: postJson,
ajaxGridOptions: { contentType: "application/json; charset=utf-8" },
serializeGridData: function(postData) {
return JSON.stringify(postData);
},
page: 1
}).trigger("reloadGrid");
//$("span .input-group-btn").addCss("popover-error"); }); }); </script>
<div style="position: absolute; top: 179px; left: 315px; z-index: 100;">
<button type="button" id="btnAudit" onclick="AuditInfo()"> 审核
</button>
</div>
@{
Html.RenderPartial("~/Administration/Views/Shared/_JqGridJsTemplate.cshtml", new JqGridModel()
{
Title = "贷款申请操作",
JqGridId = "grid-table",
Url = "/Admin/BillLoanApply/BillLoanApplyList",
ColNames = "[' ', '索引', '详细id','公司名称','公司电话','法人', '证件名称', '身份证号', '手机','借款期限','申请表复印件','状态','创建时间','申请人','申请日期','审核人','审核日期','详细']",
JsonReader = "{id: \"Id\",root: \"Data\",records: \"TotalRecords\",total: \"TotalPages\",repeatitems: false}",
ColModel = @"[
{
name: 'myac', index: '', width: 80, fixed: true, sortable: false, resize: false,subGrid: true,
formatter: 'actions',
formatoptions: {
keys: true,
delOptions: { recreateForm: true, beforeShowForm: beforeDeleteCallback },
delbutton:true
} },
{ name: 'Id', index: 'Id', width: 30, sorttype: 'int',editable:false,editoptions : {readonly : true,size : 10} },
{ name: 'DetailID', index: 'DetailID', width: 70,hidden:true,editable: false, editoptions: { size: '20', maxlength: '30' } },
{ name: 'CompanyName', index: 'CompanyName', width: 70, editable: true, editoptions: { size: '20', maxlength: '30' } },
{ name: 'CompanyPhone', index: 'CompanyPhone', width: 70,hidden:true, editable: true, editoptions: { size: '20', maxlength: '30' } },
{ name: 'Corporate', index: 'Corporate', width: 70,hidden:true,editable: true, editoptions: { size: '20', maxlength: '30' } },
{ name: 'CardName', index: 'CardName', width: 70,editable: true, editoptions: { size: '20', maxlength: '30' } },
{ name: 'CardId', index: 'CardId', width: 70,hidden:true,editable: true, editoptions: { size: '20', maxlength: '30' } },
{ name: 'Mobile', index: 'Mobile', width: 70,editable: true, editoptions: { size: '20', maxlength: '30' } },
{ name: 'LoanPeriod', index: 'LoanPeriod', width: 70,editable: true, editoptions: { size: '20', maxlength: '30' } , unformat: pickDate},
{ name: 'ApplicationCopy', index: 'ApplicationCopy', width: 70,hidden:true,editable: true, editoptions: { size: '20', maxlength: '30' } },
{ name: 'NStatus', index: 'NStatus', width: 50,editable: true,edittype:'select', editoptions: {value:'" + ViewBag.Dic + @"'} },
{ name: 'Createtime', index: 'Createtime',hidden:true, width: 70,editable: true, editoptions: { size: '20', maxlength: '30' }, unformat: pickDate },
{ name: 'Applicant', index: 'Applicant', width: 70,editable: true, editoptions: { size: '20', maxlength: '30' } },
{ name: 'ApplicationDate', index: 'ApplicationDate', width: 90,editable: true,formatter: dataformatter, editoptions: { size: '20', maxlength: '30' }, unformat: pickDate },
{ name: 'Auditor', index: 'Auditor', width: 70,formatter: dataformatter,editable: false, editoptions: { size: '20', maxlength: '30' }, unformat: pickDate },
{ name: 'AuditDate', index: 'AuditDate',hidden:true, width: 90,formatter: dataformatter, editable: true, editoptions: { size: '20', maxlength: '30' }, unformat: pickDate },
{ name: 'Id', index: 'Id', width: 150, formatter: formatModel,edittype:'custom'} ]",
PrmNames = "{page: \"page\",rows: \"PageSize\",sort: \"sidx\",order: \"sord\",search: \"_search\",nd: \"nd\",id: \"id\",oper: \"oper\",editoper: \"edit\",addoper: \"add\",deloper: \"del\",subgridid: \"id\",npage: null,totalrows: \"totalrows\"}",
UpdateUrl = "/Admin/BillLoanApply/Operation",
SubGrid = "true",
PageSize = defaultSettins.DefaultGridPageSize,
RowList = defaultSettins.GridPageSizes,
NavGridString = @"{
edit: true,
editicon: 'ace-icon fa fa-pencil blue',
add: true,
addicon: 'ace-icon fa fa-plus-circle purple',
del: true,
delicon: 'ace-icon fa fa-trash-o red',
search: false,
searchicon: 'ace-icon fa fa-search-plus grey',
refresh: false,
view: true,
viewicon: 'ace-icon fa fa-search-plus grey', },
{
//edit record form
//closeAfterEdit: true,
width: 400,
recreateForm: true,
beforeShowForm: function(e) {
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class=""widget-header"" />');
styleEditForm(form);
}
},
{
//new record form
width: 400,
closeAfterAdd: true,
recreateForm: true,
viewPagerButtons: false,
beforeShowForm: function(e) {
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar')
.wrapInner('<div class=""widget-header"" />')
styleEditForm(form);
}
},
{
//delete record form
recreateForm: true,
beforeShowForm: function(e) {
deleteCssHandle(e);
},
onClick: function(e) {
}
},
{
//search form
recreateForm: true,
afterShowSearch: function(e) {
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class=""widget-header"" />')
style_search_form(form);
},
afterRedraw: function() {
style_search_filters($(this));
},
multipleSearch: true,
/**
multipleGroup:true,
showQuery: true
*/
},
{
//view record form
recreateForm: true,
beforeShowForm: function(e) {
var form = $(e[0]);
form.closest('.ui-jqdialog').find('.ui-jqdialog-title').wrap('<div class=""widget-header"" />')
}
}",
ExtensionJavaScript = @"
function showChildGrid(parentRowID, parentRowKey) {
$.ajax({
url: ""GetApplyDetail"",
type: ""POST"",
data: { id: 5 },
success: function(jsondata) {
if (jsondata) {
var childDiv = $(""<div class='widget-main'></div>"").appendTo(""#"" + parentRowID);
$.each(jsondata, function(i, j) {
childDiv.append(""<div class=\""col-xs-12 col-lg-2\""><span class='lighter line-height-125'>""+i+""<\/span>:<span class='text-primary'>"" + j+""</span><\/div>"");
});
}
}
});
}
function formatModel(cellValue, options, rowObject) {
var imageHtml = ""<input type='button' value='查看贷款申请详细' onclick='BillLoanDetails(""+cellValue + "");' />"";
return imageHtml;
} function styleEditForm(form) {
var buttons = form.next().find('.EditButton .fm-button');
buttons.addClass('btn btn-sm').find('[class*=""-icon""]').hide();//ui-icon, s-icon
buttons.eq(0).addClass('btn-primary').prepend('<i class=""ace-icon fa fa-check""></i>');
buttons.eq(1).prepend('<i class=""ace-icon fa fa-times""></i>'); form.find('input[name=ApplicationDate]').datetimepicker({
format: 'YYYY-MM-DD HH:mm:ss'
}).next().on(ace.click_event, function () {
$(this).prev().focus();
});
form.find('input[name=LoanPeriod]').datetimepicker({
format: 'YYYY-MM-DD HH:mm:ss'
}).next().on(ace.click_event, function () {
$(this).prev().focus();
}); buttons = form.next().find('.navButton a');
buttons.find('.ui-icon').hide();
buttons.eq(0).append('<i class=""ace-icon fa fa-chevron-left""></i>');
buttons.eq(1).append('<i class=""ace-icon fa fa-chevron-right""></i>');
}
function style_delete_form(form) {
var buttons = form.next().find('.EditButton .fm-button');
buttons.addClass('btn btn-sm btn-white btn-round').find('[class*=""-icon""]').hide();//ui-icon, s-icon
buttons.eq(0).addClass('btn-danger').prepend('<i class=""ace-icon fa fa-trash-o""></i>');
buttons.eq(1).addClass('btn-default').prepend('<i class=""ace-icon fa fa-times""></i>')
}
function beforeDeleteCallback(e) {
deleteCssHandle(e);
}
function deleteCssHandle(e) {
var form = $(e[0]);
if (form.data('styled')) return false; form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class=""widget-header"" />')
style_delete_form(form); form.data('styled', true);
}" }); } }
jqGrid添加详细按钮,单击弹出窗体的更多相关文章
- Android初级教程以动画的形式弹出窗体
这一篇集合动画知识和弹出窗体知识,综合起来以动画的形式弹出窗体. 动画的知识前几篇已经做过详细的介绍,可翻阅前面写的有关动画博文.先简单介绍一下弹出窗体效果的方法: 首先,需要窗体的实例:PopupW ...
- IOS第二天-新浪微博 - 添加搜索框,弹出下拉菜单 ,代理的使用 ,HWTabBar.h(自定义TabBar)
********HWDiscoverViewController.m(发现) - (void)viewDidLoad { [super viewDidLoad]; // 创建搜索框对象 HWSearc ...
- iframe弹出窗体丢失焦点的问题
好像在不同的浏览器都有这个现象,用javascript弹出一个iframe的窗口,第一次input的焦点是正常的, 然后弹出第二次的时候,选择,按钮都可以获取到,但是input无法获得焦点,而且页面不 ...
- MVVM模式下弹出窗体
原地址:http://www.cnblogs.com/yk250/p/5773425.html 在mvvm模式下弹出窗体,有使用接口模式传入参数new一个对象的,还有的是继承于一个window,然后在 ...
- gridView AspNetPager 翻页时 弹出窗体关闭报错
gridView AspNetPager 翻页后,你右击刷新或F5会发现弹出一个刷新页面. 这是因为默认翻页都是用dopostback方式回发的.因为这时的页面已经不是原来的页面.所以会弹出提示. 这 ...
- Bootstrap datepicker 在弹出窗体modal中不工作
解决办法 在 show 方法后面 添加 下面一段代码 $('#modalCard').modal('show');—例子 打开 弹出窗体 //$('#modalCard').modal('hide') ...
- 转(C# 类似右键菜单弹出窗体)
文章来自 https://www.cnblogs.com/ahdung/p/FloatLayerBase.html 每天进步一点点 新建类 FloatLayerBase 继承Form, 自己有点小改 ...
- 尝试用React写几个通用组件 - 带搜索功能的下拉列表,开关切换按钮,弹出框
尝试用React写几个通用组件 - 带搜索功能的下拉列表,开关切换按钮,弹出框 近期正在逐步摸索学习React的用法,尝试着写几个通用型的组件,整体项目还是根据webpack+react+css-me ...
- WPF 左键单击弹出菜单 ContextMenu
原文:WPF 左键单击弹出菜单 ContextMenu WPF中的ContextMenu在XAML中可直接做出来,但是仅限于右键弹出菜单,如果需要添加左键弹出功能,只需要在事件中添加Click事件 X ...
随机推荐
- 一个关于poi导出的API
先准备需要的参数 参数1:String title=“用户信息” 参数2:String[] headers String[] headers = { "用户名", "昵称 ...
- js运算符的优先级
自上向下优先级降低 运算符 描述 . [] () 字段访问.数组下标.函数调用以及表达式分组 ++ -- - ~ ! delete new typeof void 一元运算符.返回数据类型.对象创建. ...
- PHP安装OPENSSL扩展模块
新项目上线时,PHP开发同事反映邮件功能不能正常使用. 原来是用465的SMTP加密端口,不是25端口.那要为当前的PHP安装OPENSSL扩展啦. 还好,网上有很多,弄一个过来就搞定. http:/ ...
- 深入浅出Node.js (8) - 构建Web应用
8.1 基础功能 8.1.1 请求方法 8.1.2 路径解析 8.1.3 查询字符串 8.1.4 Cookie 8.1.5 Session 8.1.6 缓存 8.1.7 Basic认证 8.2 数据上 ...
- spring framework 4 源码阅读(2)---从ClassPathXmlApplicationContext开始
Application初始化日志 15:23:12.790 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperti ...
- SPOJ375.QTREE树链剖分
题意:一个树,a b c 代表a--b边的权值为c.CHANGE x y 把输入的第x条边的权值改为y,QUERY x y 查询x--y路径上边的权值的最大值. 第一次写树链剖分,其实树链剖分只能说 ...
- 充分发挥 JavaScript 语言的优势
尽管我在生产环境中使用 JavaScript 长达 8 年之久了,但是,直到最近 2 年,我才开始学习如何正确地编写 JavaScript 代码,根据我对人们的理解,很多开发者都有类似经历.我们有相当 ...
- MyBatis映射文件的resultMap如何做表关联
MyBatis的核心是其映射文件,SqlMap文件,里面配置了项目中用到了什么SQL语句,和数据库相关的逻辑都在这个映射文件里.顾名思义,映射文件就是对Java对象和SQL的映射.这里简单介绍一下映射 ...
- Android 之窗口小部件详解(三) 部分转载
原文地址:http://blog.csdn.net/iefreer/article/details/4626274. (一) 应用程序窗口小部件App Widgets 应用程序窗口小部件(Widget ...
- 基于PCA和SVM的人脸识别
程序中采用的数据集是ORL人脸库,该人脸库共有400副人脸图像,40人,每人10幅,大小为112*92像素,同一个人的表情,姿势有少许变化. 程序的流程主要分为三部分,数据的预处理(PCA降维和规格化 ...