My second page is not loading for datatable.Everything showing in first page only.Anyone please help
My second page is not loading for datatable.Everything showing in first page only.Anyone please help
AnaghaBP
Posts: 1Questions: 1Answers: 0
I have used ajax call.I am new to jquery.These are scripts..Please help
<script>
$(document).ready(function() {
loadFindOpportunity();
});
$('#findOpportunity').on('click',function(){
loadFindOpportunity();
});
function loadFindOpportunity(findOpportunityUrl) {
var partyId = $("#partyId").val();
var name = $("#name").val();
var stage = $("#stage").val();
var currency = $("#currency").val();
var findOpportunityUrl = "getOpportunityDetails?partyId=" + partyId + "&name=" + name + "&stage=" + stage + "¤cy=" + currency;
oTable = $('#findOpportunityTable').DataTable({
"processing": true,
"serverSide": true,
"searching": false,
"destroy": true,
"ordering": true,
"ajax": {
"url": findOpportunityUrl,
"type": "POST"
},
"Paginate": true,
"columnDefs": [
{
"orderable": false,
"targets": [2]
},
{
"orderable": false,
"targets": [3]
},
],
"order": [[ 1, "ASC" ]],
"language": {
"emptyTable": "No data available in table",
"info": "Showing _START_ to _END_ of _TOTAL_ entries",
"infoEmpty": "No entries found",
"infoFiltered": "(filtered1 from _MAX_ total entries)",
"lengthMenu": "Show _MENU_ entries",
"zeroRecords": "No matching records found",
"oPaginate": {
"sNext": "Next",
"sPrevious": "Previous"
}
},
"pageLength": 10,
"bAutoWidth": false,
"stateSave": false,
"columns": [
{
"data": "partyId"
},
{
"data": "opportunityName"
},
{
"data": "stageDescription"
},
{
"data": "amount"
},
{
"data": "estClosed"
},
{
"data": "opportunityFor"
},
{
"data": "responsibleFor"
},
{
"data": "nextStep"
}
]
});
}
</script>
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
Hi @AnaghaBP ,
I can only see one table being initialised. We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin