58 lines
1.9 KiB
Plaintext
58 lines
1.9 KiB
Plaintext
<!-- AllPR.cshtml - Example View Component -->
|
|
<div class="tab-content-wrapper">
|
|
<table id="PRTable" class="row-border" cellspacing="0" width="100%">
|
|
<thead >
|
|
<tr>
|
|
<th style="width:7%">PRNo</th>
|
|
<th style="width:7%">New PRNo</th>
|
|
<th style="width:50%">ItemName's</th>
|
|
<th style="width:9%">Req. Date</th>
|
|
<th style="width:14%">Req. By</th>
|
|
<th style="width:8%">DateNeeded</th>
|
|
<th style="width:7%">ChargeTo</th>
|
|
<th style="width:7%">Action</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
loader = $('#overlay, #loader');
|
|
|
|
UserRights = document.getElementById("roleRights").value;
|
|
|
|
prTable = $('#PRTable').DataTable({
|
|
ajax: {
|
|
url: '/PRMgmt/GetAllPR',
|
|
type: 'GET',
|
|
beforeSend: function () {
|
|
loader.show();
|
|
},
|
|
complete: function () {
|
|
loader.hide();
|
|
},
|
|
error: function (xhr, error, thrown) {
|
|
loader.hide();
|
|
console.error('Error loading data:', error);
|
|
if (typeof toastr !== 'undefined') {
|
|
toastr.error('Failed to load data. Please try again.');
|
|
}
|
|
}
|
|
},
|
|
initComplete: initCompleteCallback,
|
|
columns: colOnPRTable,
|
|
order: [[3, 'asc']],
|
|
rowCallback: rowStatusColorCallback,
|
|
responsive: true,
|
|
language: {
|
|
emptyTable: "No record available",
|
|
loadingRecords: "Loading data...",
|
|
processing: "Processing..."
|
|
},
|
|
error: errorHandler
|
|
});
|
|
});
|
|
</script> |