Editable DataTable Server-Side Processing

Editable DataTable Server-Side Processing

NJDave71NJDave71 Posts: 40Questions: 3Answers: 0
edited June 2011 in General
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

Replies

  • NJDave71NJDave71 Posts: 40Questions: 3Answers: 0
    Within the "aoColumns": [ ] How can I trigger another Function once a Status is Assigned. For example Send an Email.

    Thanks
  • adrianupadrianup Posts: 1Questions: 0Answers: 0
    Hello I was looking for ways to load the input of type select and thanks to your code I could do now the problem is not like the response format handle to load the data in the select, would appreciate enormously if he gives me an example of that. adrian175@ gmail.com
This discussion has been closed.