Editor - Select drop down

Editor - Select drop down

tiebreaktechtiebreaktech Posts: 20Questions: 3Answers: 1
edited June 2015 in Plug-ins

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

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Hi,

    The error suggests that there is not place_id.label for that row. Perhaps the value is null? If so use the columns.defaultContent option to set a "default" to display in the table.

    Allan

  • tiebreaktechtiebreaktech Posts: 20Questions: 3Answers: 1

    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 } ].

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Answer ✓

    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

This discussion has been closed.