Editor - Select drop down
Editor - Select drop down
tiebreaktech
Posts: 20Questions: 3Answers: 1
hello, i have a problem.
i'm using datatable + editor with some select fields. the code is something like this:
function load_table() {
var table = $('#gare').DataTable({
aaSorting: [[1,'asc'],[0,'asc']],
destroy: true,
paging: false,
data: data,
dom: 'Tfrtip',
columns: [
{ data: "numero" },
{ data: "pool" },
{ data: "fase" },
{ data: "genre" },
{ data: "data" },
{ data: "place_id.label", editField: "place_id.value"},
{ data: "h" },
{ data: "m" },
.......
function create_editor() {
editor = new $.fn.dataTable.Editor( {
table: "#gare",
ajax: "rest_api/matches/edit_schedule?client_name="+client_name,
fields: [{
name: "numero", type: "hidden"
},{
name: "pool", type: "hidden"
},{
name: "fase", type: "hidden"
},{
name: "genre", type: "hidden"
},{
label: "Data", name: "data", type: "date", dateFormat: "yy-mm-dd"
},{
label: "Campo", name: "place_id.value", type: "select", options: campi
},{
label: "h", name: "h", type: "number"
},{
.....
with PLACE_ID i get this error :
DataTables warning: table id=gare - Requested unknown parameter 'place_id.label' for row 17. For more information about this error, please see http://datatables.net/tn/4
can you help me understand the problem??
thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
The error suggests that there is not
place_id.label
for that row. Perhaps the value isnull
? If so use thecolumns.defaultContent
option to set a "default" to display in the table.Allan
i forgot to tell that it appens only when i edit the row. the data is present.
there's a global variable campi which is like campi : [ { label: "xxx", value: xxx }, { label: "xxx", value: xxx } ].
Thanks for the additional information. That suggests that the server isn't replying with the full data for the row as required in the Editor client / server data interchange.
Would that be correct? Specifically the
row
parameter in the edit change return should be fully populated.Allan