Data Manager Plugin Custom Select Editor (Issue with Order & Selected Option)

Data Manager Plugin Custom Select Editor (Issue with Order & Selected Option)

atomicx6637atomicx6637 Posts: 3Questions: 0Answers: 0
edited August 2012 in General
I have a data table that I'm applying the data manager plugin to in order to be able to do custom editor in the table. Specifically I would like to use the select editor which I can get to work just fine. I'm having 2 issues one I would like the data in the list to be order according to the text that is being displayed and the other is that when I try to add the "selected" option to the value that should be selected in the list it
doesn't work.

Has anyone else encountered these challenges and have you been able to solve them or have some insight on how I could attempt to solve them.

Thanks
Troy

Here is the code I'm working with:

[code]
var oTable = $("#dataTable").dataTable( {
"bProcessing": true,
"bServerSide": true,
"bPaginate": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"iDisplayLength": 25,
"sAjaxSource": "PCServ?controllerId=FARController&methodId=getFAREditData2"
}).makeEditable( {
sUpdateURL: "PCServ?controllerId=FARController&methodId=submitFARData2",
fnOnEdited: function(status)
{
if (status == "failure")
{
$("#errorTrace").text("Sorry there has been an issue while updating the record!");
$("#errorTrace").show();
$("#successTrace").hide();
}
else
{
$("#successTrace").text("The column data has been successfully updated!");
$("#successTrace").show();
$("#errorTrace").hide();
}
},
"aoColumns" : [
{ },
{ },
{
indicator: 'Saving Contract Number...',
tooltip: 'Click to select a contract number!',
loadtext: 'loading...',
type: 'select',
onblur: 'cancel',
submit: 'Ok',
loadtype: 'POST',
loadurl: 'PCServ?controllerId=ContractController&methodId=getContractDropDownData',
loaddata : function (value, settings) {
return {contractNumber: value};
}
},
null,
{ },
{ },
{ },
{ },
{ },
{ },
{ }
]
});
[/code]

I have also been trying to intercept the data set that is returned from an AJAS query in order to apply the sorting order to it before it builds the dropdown list but I haven't had any luck.

Here is the code I have been working with on that:

This piece would replace the loadtype, loadurl, loaddata records from the above code.
[code]
data: function(value, settings){
var groups = new Array();

getData(function(data){
alert(data);
groups = data;
});

return groups;
}
[/code]

[code]
function getData(callback) {

var groups = new Array;

$.ajax({
url: 'PCServ?controllerId=ContractController&methodId=getContractDropDownData',
dataType : 'json',
success: function(data){
$.each(data, function(i,geo){
groups.push([i + ":" + geo]);
});

callback.call(this, groups);
}
});
}
[/code]
This discussion has been closed.