Editing orthogonal data using select

Editing orthogonal data using select

eddiefantasticeddiefantastic Posts: 7Questions: 3Answers: 0

I'm new to Editor, I have it working on text fields but this eludes me.

I'm trying to edit orthogonal data, my column is set as so

 "columns": [
    { "data": {
        _: "active.display",
        sort: "active.sort",
        filter: "active.filter",
        export: "active.export"
    }
],

json for this column looks like this...

"active":{
    "display":"<i class=\"far fa-check\" style=\"color: green;\"><\/i>",
    "sort":"1",
    "filter":"1",
    "export":"1"
}

or this...

"active":{
    "display":"<i class=\"far fa-times\" style=\"color: red;\"><\/i>",
   "sort":0,
    "filter":0,
    "export":0
}

and datatables works as it should. I'm struggling with how to edit this data. I've added this to the editor fields...

{
    label: "Active:",
    name:  "active",
    type:  "select",
    options: [
        { label: "Not Active", value: "0" },
        { label: "Active",    value: "1" },
    ]
}

but when I try to edit (I'm using inline editing) I get the error...

Uncaught Unable to automatically determine field from source. Please specify the field name. For more information, please refer to https://datatables.net/tn/11

I've followed the instructions as best I could on that page. Changing the columns to...

"columns": [
    { "data": {
        _: "active.display",
        sort: "active.sort",
        filter: "active.filter",
        export: "active.export"
    }, editField: "active.filter"}
],

But I still get the same error.

Answers

  • eddiefantasticeddiefantastic Posts: 7Questions: 3Answers: 0
    edited May 2020

    Ignore me. It seems a combination of..

    editField: "active.filter"}
    

    and

    name:  "active.filter",
    

    works. Thought I'd tried that but seems not.

This discussion has been closed.