需求描述:
1.前台页面
1》//行点击事件_20170217
onClickRow: function (index, row) {
OpenData(row.code, row.Monidate);
}
2》//VOC排序功能
function OpenData(Stationcode, Monidate) {//, Monidate
var dataType = "hour";
$.each($('.btn-dataType'), function (index, btnItem) {
if ($(this).hasClass("l-btn-selected")) {
dataType = $(this).attr("data-code");
return;
}
});
MapuniDialog.open({
id: 'AccuracyDetail',//弹窗的id
title: getName(Stationcode) +"_"+Monidate+ "_Voc监测数据排序",//必填
url: '@Url.Action("Sort")' + '?Stationcode=' + Stationcode + '&Monidate=' + Monidate + '&dataType=' + dataType, //+ '?dateRange="2016-10-19"&dataType="hour"' + Monidate
width: 400,
height: 550,
data: null,//传入页面中的参数
position: { left: 100, top: 100 },//显示位置
lock: true,//是否锁屏
callback: null//弹窗页面加载完成后的事件,回调方法可获得打开页面的window对象,(如果地图为弹窗打开方式的话使用此方法比较合适,来确定地图加载完成方法)
});
}
3》//根据站点编码获取站点名称
function getName(Stationcode) {
var name = "";
switch (Stationcode) {
case "500000001":
name = "科创十四街";
break;
case "500000002":
name = "宾仕国际";
break;
}
return name;
}
2.弹框--排序页面
@{
ViewBag.Title = "Sort";
Layout = "~/Views/Shared/_LayoutCommJs.cshtml";
}
<style>
.datagrid-header td {
background-color: rgb(0, 122, 255);
}
</style>
<div class="easyui-layout" data-options="fit:true,border:false">
<div data-options="region:'north',border:true" class="datagrid-toolbar" style="height: 50px; padding-left: 20px; padding-top: 9px; border: none; ">
<div style="width: 100%; padding-bottom: 5px;">
<table>
<tr>
<td>
排序:
<select id="sort" class="easyui-combobox" data-options="width:130">
<option value="asc" selected>升序</option>
<option value="desc">降序</option>
</select>
</td>
</tr>
</table>
</div>
</div>
<div data-options="region:'center',border:false" style="overflow-y: auto;">
<div class="easyui-panel" data-options="height:430,border:false" style="width:200px;">
<table id="dt_dayw" data-options="rownumbers:true,width:200">
<thead>
<tr>
<th id="Name" data-options="field:'name',width:100,align:'center'" style="background-color:red">监测项</th>
<th data-options="field:'value',width:100,sortable:'true'">浓度<br/>(ug/m³)</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
<script>
$(function () {
debugger;
loadtable("asc");
$('#sort').combobox({