Pop Up Message
Pop Up Message
bramha007
Posts: 4Questions: 0Answers: 0
Hi,
I am trying to display a jQuery Dialog confirm box when i select "All" rows option from drop down. In the Dialog box i have 2 button OK and CANCEL. clicking OK will display all records and clicking CANCEL will display default rows(in my case it is 50). But when the dialog box open, before i select any button the "fnServerData" processess the data using "All"(-1) and displays the data. How do i stop the processing untill i confirm which action to take place?
Below is the code
[code]
dataTable = $('#exampleTable').dataTable( {
"iDisplayLength": 50,
"bProcessing": true,
"bServerSide": true,
"oLanguage": {
"sLengthMenu": 'Display '+
'10'+
'25'+
'50'+
'100'+
'All'+
' records'
},
"sAjaxSource": "{!ajaxUrl}?aid='abc',
"bStateSave": false,
"bDeferRender": true,
"aaSorting": [[ 1, "asc" ]],
"aoColumns": [
{"sType": "html", "bSortable": false, "sWidth": "40px"},
{"sType": "html", "sWidth": "130px"},
{"sType": "html", "sWidth": "40px"},
{"sType": "html", "sWidth": "30px"},
{"sType": "html", "sWidth": "20px"},
{"sType": "html", "sWidth": "30px"},
{"sType": "html", "sWidth": "30px"},
{"sType": "html", "sWidth": "30px"},
{"sType": "html", "sWidth": "30px"},
{"sType": "html", "sWidth": "20px"},
{"sType": "html", "sWidth": "30px"}],
"fnServerData" : function ( url, data, callback, settings ) {
$('.records_options').live('change' ,function() {
if($(this).val() == -1 ) {
$('#confirmMsg').html('Confirm');
$('#confirmDiv').dialog('open');
}
oTable = dataTable;
});
$.ajax( {
"url": "{!ajaxUrl}?id='abc',
"data": data,
"success": function (json) {
callback( json );
},
"dataType": "json",
"cache": false
} );
},
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
// do row processing
return nRow;
}
});
[/code]
I am trying to display a jQuery Dialog confirm box when i select "All" rows option from drop down. In the Dialog box i have 2 button OK and CANCEL. clicking OK will display all records and clicking CANCEL will display default rows(in my case it is 50). But when the dialog box open, before i select any button the "fnServerData" processess the data using "All"(-1) and displays the data. How do i stop the processing untill i confirm which action to take place?
Below is the code
[code]
dataTable = $('#exampleTable').dataTable( {
"iDisplayLength": 50,
"bProcessing": true,
"bServerSide": true,
"oLanguage": {
"sLengthMenu": 'Display '+
'10'+
'25'+
'50'+
'100'+
'All'+
' records'
},
"sAjaxSource": "{!ajaxUrl}?aid='abc',
"bStateSave": false,
"bDeferRender": true,
"aaSorting": [[ 1, "asc" ]],
"aoColumns": [
{"sType": "html", "bSortable": false, "sWidth": "40px"},
{"sType": "html", "sWidth": "130px"},
{"sType": "html", "sWidth": "40px"},
{"sType": "html", "sWidth": "30px"},
{"sType": "html", "sWidth": "20px"},
{"sType": "html", "sWidth": "30px"},
{"sType": "html", "sWidth": "30px"},
{"sType": "html", "sWidth": "30px"},
{"sType": "html", "sWidth": "30px"},
{"sType": "html", "sWidth": "20px"},
{"sType": "html", "sWidth": "30px"}],
"fnServerData" : function ( url, data, callback, settings ) {
$('.records_options').live('change' ,function() {
if($(this).val() == -1 ) {
$('#confirmMsg').html('Confirm');
$('#confirmDiv').dialog('open');
}
oTable = dataTable;
});
$.ajax( {
"url": "{!ajaxUrl}?id='abc',
"data": data,
"success": function (json) {
callback( json );
},
"dataType": "json",
"cache": false
} );
},
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
// do row processing
return nRow;
}
});
[/code]
This discussion has been closed.