Editable DataTable Server-Side Processing
Editable DataTable Server-Side Processing
Hi, I need some help here on a couple of things.
I have read through the Editable DataTable examples and I am using Server Side to load and handle the data.
I followed the example at
http://jquery-datatables-editable.googlecode.com/svn/trunk/server_side_processing.html
I am using Firebug to to see what happends and I noticed that after the POST is made and the sAjaxSource GET is executed. I am wondering if this is suppose to happen and can it be prevented?
How do you pass a new "loaddata" parameter? I keeps passing the same value eventhough it changes when I Select a new Item from a dropdown?
Here is my jQuery
[code]
$(document).ready(function () {
var oTable = $('#example').dataTable({
"sAjaxSource": "service/GetData.ashx",
"aoColumns": [
/* Card ID */{"bVisible": false },
/* Card Ref Number */null,
/* DOB */null,
/* Member ID */null,
/* Name */null,
/* Email */null,
/* Account Type */null,
/* Usage Count */null,
/* Member Start Date */null,
/* Member EXP Date */null,
/* Account Notes */null,
/* Rep ID */null,
/* Status */null
],
"aaSorting": [[8, "DESC"]],
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": { "sSearch": "Search by column:" },
"fnServerData": function (sSource, aoData, fnCallback) {
aoData.push({ "name": "StatusFilter", "value": $('#statusFilter option:selected').val() });
aoData.push({ "name": "iSearchCol", "value": $('#iSearchCol').val() });
$.getJSON(sSource, aoData, function (json) {fnCallback(json) });
}
}).fnFilterOnReturn().makeEditable({
sUpdateURL: "service/updatedata.ashx",
"aoColumns": [
null,
null,
null,
null,
null,
null,
null,
null,
null,
{
tooltip: 'Click to select Note',
loadtext: 'loading...',
type: 'select',
onblur: 'cancel',
submit: 'Ok',
loadurl: 'service/getReasons.ashx',
loadtype: 'POST',
loaddata: { "StatusFilter": $("#statusFilter").val()},
sUpdateURL: "service/updatedata.ashx"
},
{
tooltip: 'Click to select Operator',
loadtext: 'loading...',
type: 'select',
onblur: 'cancel',
submit: 'Ok',
loadurl: 'service/getReasons.ashx',
loadtype: GET',
loaddata: { "StatusFilter": $("#statusFilter").val()},
sUpdateURL: "service/updatedata.ashx"
}, {
indicator: 'Saving Status...',
tooltip: 'Click to select Status',
loadtext: 'loading...',
type: 'select',
onblur: 'submit',
data: "{'':'Please select...', '1':'Active','2':'Hold','3':'Suspended','4':Closed}" }
]
});
$("#statusFilter").change(function () {
oTable.fnFilter("", 0);
});
$("#iSearchCol").insertBefore("#example_filter input");
$("#statusFilter").insertBefore("#example_length Select");
});
[/code]
Thank You
I have read through the Editable DataTable examples and I am using Server Side to load and handle the data.
I followed the example at
http://jquery-datatables-editable.googlecode.com/svn/trunk/server_side_processing.html
I am using Firebug to to see what happends and I noticed that after the POST is made and the sAjaxSource GET is executed. I am wondering if this is suppose to happen and can it be prevented?
How do you pass a new "loaddata" parameter? I keeps passing the same value eventhough it changes when I Select a new Item from a dropdown?
Here is my jQuery
[code]
$(document).ready(function () {
var oTable = $('#example').dataTable({
"sAjaxSource": "service/GetData.ashx",
"aoColumns": [
/* Card ID */{"bVisible": false },
/* Card Ref Number */null,
/* DOB */null,
/* Member ID */null,
/* Name */null,
/* Email */null,
/* Account Type */null,
/* Usage Count */null,
/* Member Start Date */null,
/* Member EXP Date */null,
/* Account Notes */null,
/* Rep ID */null,
/* Status */null
],
"aaSorting": [[8, "DESC"]],
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": { "sSearch": "Search by column:" },
"fnServerData": function (sSource, aoData, fnCallback) {
aoData.push({ "name": "StatusFilter", "value": $('#statusFilter option:selected').val() });
aoData.push({ "name": "iSearchCol", "value": $('#iSearchCol').val() });
$.getJSON(sSource, aoData, function (json) {fnCallback(json) });
}
}).fnFilterOnReturn().makeEditable({
sUpdateURL: "service/updatedata.ashx",
"aoColumns": [
null,
null,
null,
null,
null,
null,
null,
null,
null,
{
tooltip: 'Click to select Note',
loadtext: 'loading...',
type: 'select',
onblur: 'cancel',
submit: 'Ok',
loadurl: 'service/getReasons.ashx',
loadtype: 'POST',
loaddata: { "StatusFilter": $("#statusFilter").val()},
sUpdateURL: "service/updatedata.ashx"
},
{
tooltip: 'Click to select Operator',
loadtext: 'loading...',
type: 'select',
onblur: 'cancel',
submit: 'Ok',
loadurl: 'service/getReasons.ashx',
loadtype: GET',
loaddata: { "StatusFilter": $("#statusFilter").val()},
sUpdateURL: "service/updatedata.ashx"
}, {
indicator: 'Saving Status...',
tooltip: 'Click to select Status',
loadtext: 'loading...',
type: 'select',
onblur: 'submit',
data: "{'':'Please select...', '1':'Active','2':'Hold','3':'Suspended','4':Closed}" }
]
});
$("#statusFilter").change(function () {
oTable.fnFilter("", 0);
});
$("#iSearchCol").insertBefore("#example_filter input");
$("#statusFilter").insertBefore("#example_length Select");
});
[/code]
Thank You
This discussion has been closed.
Replies
Thanks