MVC 用EasyUI
来源:互联网 发布:移动网络电视首页 编辑:程序博客网 时间:2024/05/17 12:04
var _opItem = "Add";
var _rowIndex = 0;
var _Row;
var _pageIndex = 1;
var _pageSize = 20;
function GetCarType(pageIndex, pageSize) {
var BiGuidedPrice = $("#BiGuidedPrice").val() == "" ? 0 : $("#BiGuidedPrice").val();
var EiGuidedPrice = $("#EiGuidedPrice").val() == "" ? 0 : $("#EiGuidedPrice").val();
$('#CarType').datagrid({
title: '车型信息',
singleSelect: true, //是否单选
pagination: true, //分页控件
rownumbers: true, //行号
loadMsg: '数据加载中请稍后……',
queryParams: {
pageIndex: pageIndex, pageSize: pageSize,
sBrandName: $("#sBrandName").val(), sFirmName: $("#sFirmName").val(), sModelName: $("#sModelName").val(),
sDisplacementName: $("#sDisplacementName").val(), sTransmissionMmodelName: $("#sTransmissionMmodelName").val(),
BiGuidedPrice: BiGuidedPrice, EiGuidedPrice: EiGuidedPrice
},
url: '/BaseInfo/CarType/GetCarType',
idField: 'ID',
columns: [[
{ field: 'SFIRSTLETTER', title: '首字母', width: 40, align: 'center' },
{ field: 'SBRAND', title: '品牌', width: 100, align: 'center' },
{ field: 'SFIRM', title: '厂商', width: 120, align: 'center' },
{ field: 'SMODEL', title: '型号', width: 90, align: 'center' },
{ field: 'IYEARSSTYLE', title: '年代款型', width: 250, align: 'left' },
{ field: 'SDISPLACEMENT', title: '排量', width: 60, align: 'center' },
{ field: 'STRANSMISSIONMMODEL', title: '变速箱', width: 100, align: 'center' },
{ field: 'SENGINE', title: '发动机类型', width: 70, align: 'center' },
{ field: 'IGUIDEDPRICE', title: '指导价(万)', width: 70, align: 'center' }
]],
onLoadSuccess: function (data) {
if (data.total > 0) {
if (_opItem == "Add" || _rowIndex > data.rows.length) {
//默认选中首行
$(this).datagrid('selectRow', 0);
}
else {
$(this).datagrid('selectRow', _rowIndex);
}
//获取选中行
_Row = $("#CarType").datagrid("getSelected");
}
},
onClickRow: function (rowIndex, rowData) {
if (rowData) {
_rowIndex = rowIndex;
_Row = rowData;
}
}
});
//设置分页控件
var p = $('#CarType').datagrid('getPager');
$(p).pagination({
showPageList: false,
pageSize: 20, //每页显示的记录条数,1
beforePageText: '第', //页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '共 {total} 条记录',
onSelectPage: function (pageNumber, pageSize) {
_pageIndex = pageNumber;
GetCarTypes(pageNumber, pageSize);
$('#CarType').datagrid('options').pageNumber = _pageIndex;
}
});
var BiGuidedPrice = $("#BiGuidedPrice").val() == "" ? 0 : $("#BiGuidedPrice").val();
var EiGuidedPrice = $("#EiGuidedPrice").val() == "" ? 0 : $("#EiGuidedPrice").val();
AjaxCall("/BaseInfo/CarType/GetCarType", {
pageIndex: pageNumber, pageSize: pageSize,
sBrandName: $("#sBrandName").val(), sFirmName: $("#sFirmName").val(), sModelName: $("#sModelName").val(),
sDisplacementName: $("#sDisplacementName").val(), sTransmissionMmodelName: $("#sTransmissionMmodelName").val(),
BiGuidedPrice: BiGuidedPrice, EiGuidedPrice: EiGuidedPrice
},
function (res) {
$('#CarType').datagrid('loadData', { "total": res.total, "rows": res.rows });
});
}
var _rowIndex = 0;
var _Row;
var _pageIndex = 1;
var _pageSize = 20;
function GetCarType(pageIndex, pageSize) {
var BiGuidedPrice = $("#BiGuidedPrice").val() == "" ? 0 : $("#BiGuidedPrice").val();
var EiGuidedPrice = $("#EiGuidedPrice").val() == "" ? 0 : $("#EiGuidedPrice").val();
$('#CarType').datagrid({
title: '车型信息',
singleSelect: true, //是否单选
pagination: true, //分页控件
rownumbers: true, //行号
loadMsg: '数据加载中请稍后……',
queryParams: {
pageIndex: pageIndex, pageSize: pageSize,
sBrandName: $("#sBrandName").val(), sFirmName: $("#sFirmName").val(), sModelName: $("#sModelName").val(),
sDisplacementName: $("#sDisplacementName").val(), sTransmissionMmodelName: $("#sTransmissionMmodelName").val(),
BiGuidedPrice: BiGuidedPrice, EiGuidedPrice: EiGuidedPrice
},
url: '/BaseInfo/CarType/GetCarType',
idField: 'ID',
columns: [[
{ field: 'SFIRSTLETTER', title: '首字母', width: 40, align: 'center' },
{ field: 'SBRAND', title: '品牌', width: 100, align: 'center' },
{ field: 'SFIRM', title: '厂商', width: 120, align: 'center' },
{ field: 'SMODEL', title: '型号', width: 90, align: 'center' },
{ field: 'IYEARSSTYLE', title: '年代款型', width: 250, align: 'left' },
{ field: 'SDISPLACEMENT', title: '排量', width: 60, align: 'center' },
{ field: 'STRANSMISSIONMMODEL', title: '变速箱', width: 100, align: 'center' },
{ field: 'SENGINE', title: '发动机类型', width: 70, align: 'center' },
{ field: 'IGUIDEDPRICE', title: '指导价(万)', width: 70, align: 'center' }
]],
onLoadSuccess: function (data) {
if (data.total > 0) {
if (_opItem == "Add" || _rowIndex > data.rows.length) {
//默认选中首行
$(this).datagrid('selectRow', 0);
}
else {
$(this).datagrid('selectRow', _rowIndex);
}
//获取选中行
_Row = $("#CarType").datagrid("getSelected");
}
},
onClickRow: function (rowIndex, rowData) {
if (rowData) {
_rowIndex = rowIndex;
_Row = rowData;
}
}
});
//设置分页控件
var p = $('#CarType').datagrid('getPager');
$(p).pagination({
showPageList: false,
pageSize: 20, //每页显示的记录条数,1
beforePageText: '第', //页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '共 {total} 条记录',
onSelectPage: function (pageNumber, pageSize) {
_pageIndex = pageNumber;
GetCarTypes(pageNumber, pageSize);
$('#CarType').datagrid('options').pageNumber = _pageIndex;
}
});
}
function GetCarTypes(pageNumber, pageSize) {var BiGuidedPrice = $("#BiGuidedPrice").val() == "" ? 0 : $("#BiGuidedPrice").val();
var EiGuidedPrice = $("#EiGuidedPrice").val() == "" ? 0 : $("#EiGuidedPrice").val();
AjaxCall("/BaseInfo/CarType/GetCarType", {
pageIndex: pageNumber, pageSize: pageSize,
sBrandName: $("#sBrandName").val(), sFirmName: $("#sFirmName").val(), sModelName: $("#sModelName").val(),
sDisplacementName: $("#sDisplacementName").val(), sTransmissionMmodelName: $("#sTransmissionMmodelName").val(),
BiGuidedPrice: BiGuidedPrice, EiGuidedPrice: EiGuidedPrice
},
function (res) {
$('#CarType').datagrid('loadData', { "total": res.total, "rows": res.rows });
});
}
0 0
- MVC 用EasyUI
- spring mvc+easyui 初试-
- mvc easyui checkbox
- spring mvc + MyBatis + Easyui
- spring mvc+easyui导入
- MVC+EasyUi环境搭建
- .Net Mvc+Easyui 分页
- mvc中使用easyui-datagrid
- .NET MVC Jquery EasyUI Demo
- easyui+.net mvc(tree数据格式)
- mvc增删改+EasyUI+Ajax
- 【EasyUI+MVC-搭建后台框架】
- easyui+mvc+accordion菜单栏加载
- Easyui+MVC行内编辑
- EasyUi+mvc增删改查
- 在MVC中引用EasyUI
- 用easyui-filebox上传Excel文件(ASP.NET MVC)[附源码下载]
- .NET MVC Jquery EasyUI 联合应用示例
- bugFree系统环境搭建 及 bugFree搭建常见问题
- Early-Z技术
- NOIP 2014(COGS 1805) 飞扬的小鸟 完全背包
- nagios在第一次监控windows所必须修改的内容
- shell中条件判断if中的-a到-z的意思
- MVC 用EasyUI
- java代码
- UVA 10815 Andy's First Dictionary
- Early Z Rejection
- 内核模块的开发
- Android 发送Post请求上传图片(以InputStream为数据交互)
- FindBugs错误修改指南
- Java数据库操作
- MVC修改 (当前页面开启Dialog,不用Ifram)