8.7w+
社区成员
function InitDataGrid() {
if ($('#gdView')[0] != null) {
debugger;
var oTable = $('#gdView').dataTable({
"bJQueryUI": false,
"sDom": '<"H"CT><"F"itrp>',
"oColVis": { "buttonText": "显示隐藏列" },
"oTableTools": { "sSwfPath": "../../Scripts/TableTools-2.0.1/media/swf/copy_cvs_xls_pdf.swf", "aButtons": [{ sTableId: "gdView", "sExtends": "text", "sButtonText": "导出CVS", "fnClick": function(nButton, oConfig) { try { if (typeof (eval('Table_ExportData')) == "function") eval("Table_ExportData").call(document, nButton, oConfig); } catch (e) { alert("未实现功能"); } } }] },
"bProcessing": false,
"bServerSide": true,
"bLengthChange": false,
"iDisplayLength": PageLen, "iDisplayStart": document.getElementById(PagePrefix + '_PageNumber') == null ? 0 : document.getElementById(PagePrefix + '_PageNumber').value,
'bPaginate': true,
"bAutoWidth": true,
"bFilter": false,
"bSort": false,
"bInfo": true, "sPaginationType": "full_numbers",
"aoColumns": [
{ "sName": "Name", "sTitle": "部门/医生", "sWidth": "18%" },
{ "sName": "门诊量", "sTitle": "门诊量", "sWidth": "7%" },
{ "sName": "新诊", "sTitle": "新诊", "sWidth": "5%" },
{ "sName": "首次新诊", "sTitle": "首次新诊", "sWidth": "5%" },
{ "sName": "再次新诊", "sTitle": "再次新诊", "sWidth": "5%" },
{ "sName": "复诊", "sTitle": "复诊", "sWidth": "5%" },
{ "sName": "转入量", "sTitle": "转入量", "sWidth": "10%" },
{ "sName": "转出量", "sTitle": "转出量", "sWidth": "10%" },
{ "sName": "折前金额", "sTitle": "折前金额", "sWidth": "8%" },
{ "sName": "折扣金额", "sTitle": "折扣金额", "sWidth": "8%" },
{ "sName": "实收金额", "sTitle": "实收金额", "sWidth": "8%" },
{ "sName": "BranchId", "bVisible": false },
{ "sName": "CreateId", "bVisible": false },
{ "sName": "DepId", "bVisible": false }
],
"oLanguage": {
"sUrl": "../../Scripts/Datatables/cn.txt"
},
"sAjaxSource": "../../WebServices/VE_OutpatientReportService.asmx/GetVE_OutpatientReportList",
"fnRowCallback": function(nRow, aData, iDisplayIndex) {
if (aData[11] != "0" && aData[12] == "0" && aData[13] == "0") {
$('td', nRow).css('background-color', '#A9F5F2');
}
if (aData[11] != "0" && aData[12] == "0" && aData[13] != "0") {
$('td', nRow).css('background-color', '#E2E1E1');
}
return nRow;
},
"fnServerData": retrieveData
});
DataTablesSetting();
}
}
function retrieveData(sSource, aoData, fnCallback) {
var thisid = $(this)[0].id;
document.getElementById(PagePrefix + '_PageNumber').value = this.fnSettings()._iDisplayStart;
Table_PushParam(aoData);
$.ajax({
type: "post",
contentType: "application/json;utf-8",
url: sSource,
dataType: 'json',
data: GetJsonParam(aoData),
success: function(data) {//这里data要怎么处理,才能将里面的想要的值提取出来
var o = eval("(" + data.d + ")"); if (o.iTotalRecords <= PageLen) { $("#" + thisid + "_wrapper .dataTables_info").hide(); $("#" + thisid + "_wrapper .dataTables_paginate").hide(); $("#" + thisid + "_wrapper .fg-toolbar").css('padding', '0'); } else { $("#" + thisid + "_wrapper .dataTables_info").show(); $("#" + thisid + "_wrapper .dataTables_paginate").show(); $("#" + thisid + "_wrapper .fg-toolbar").css('padding', '5'); } fnCallback(o);
}
});
}