Hey Alan.
I have a Datatable setup and Editor, and everything is working splendidly EXCEPT for one thing.
I have one field defined as a SELECT with MULTIPLE, but normally (meaning when DT is browsing the records) the column displays a COLUMN DELIMITED LIST.
When I click on the cell, it switches into EDIT mode, and displays the MULTIPLE SELECT populated with a list of users.
However, I cannot for the life of me figure out how to preselect the same users in the select that are in the list that makeup the value of the cell.
HELP!
EDITOR definition:
editor = new $.fn.dataTable.Editor({
ajax: "drlAndTitle_test.cfc?method=dtAction",
table: "#drltitletable",
idSrc: "ELINID",
fields: [ {
label: "REVIEWERS:",
name: "REVIEWERS",
type: "select",
multiple: true
}
});
The following code is what I use to preload the SELECT:
$.ajax({
type: "GET",
datatype: 'json',
url: "drlAndTitle_test.cfc?method=getMemberListByRole&ReturnFormat=json",
data: {PROJECTSPECIFIC: ps,t:2},
success: function(newOptions){
var t = JSON.parse(newOptions);
editor.field( 'REVIEWERS' ).update( t.DATA );
},
fail: function(response){
alert(response);
}
});
How do I convert the CELL value (of a comma delimited list) into PRESELECTED values when the SELECT is displayed for EDIT MODE?
Example of the CELL value:
ABSMITH, ACBEQARI, ACDANIEL, ACLANDSBURG
Perhaps I am just being think headed... and there is a way to have Editor just select the values that are present in the list... I just don't see it.
Thanks for your help!