@using Resources;
<style>
table.dataTable td:nth-child(7) {
width: 430px;
max-width: 430px;
word-break: break-all;
white-space: nowrap;
}
</style>
$(document).ready(function () {
var myIP = '
@ViewBag.IP';
var table = $("#
@ViewBag.DivId").DataTable({
"ajax": {
"url": "/api/list/Person?op=" + '
@ViewBag.Qs["op"]',
"dataSrc": ""
},
dom: '<"toolbar">' + '<"top">frt<"bottom"lpi><"clear">',
"rowId": "ID",
"columns": [
{ "data": "ID" },
{ "data": "Name" },
{
"data": null,
"className": "center",
"defaultContent": '
@Resource.Show'
}
],
"columnDefs": [
{
"targets": [0],
"visible": false,
"searchable": false
}
]
});
$('#
@ViewBag.DivId').on('click', 'tr', function (evt) {
var $cell = $(evt.target).closest('td');
if ($cell.index() == 7) {
return;
}
var rowData = table.row(this).data();
if (rowData && rowData.ID) {
var url = "/Detaail/Person/" + rowData.ID;
window.location.href = url;
}
});
Refresh = function () {
table.ajax.reload();
}
});