Tabulator: tickCross editing

Created on 31 May 2017  路  4Comments  路  Source: olifolkerd/tabulator

When I have a field set up & formatted with tickCross (integer 0 or 1), when I try to edit it, I see the edit checkbox, but can't change the state when I click on the checkbox. Is this a bug, or what have I set up wrong?

Thanks, Bill

Question - Ask On Stack Overflow

Most helpful comment

Hey,

In this case i would actually recommend a different approach to make the editing a smoother experience.

I would recommend that you don't use an editor but instead use the cellClick function and the getValue and setValue functions on the cell component:

{title:"CheckBox", field:"field12", sortable: true, sorter: "number", align: "center", formatter: "tickCross", responsive: 1, cellClick:function(e, cell){
    cell.setValue(!cell.getValue());
}},

Let me know if that helps

Cheers

Oli

All 4 comments

Hey Bill,

Could you post a copy of your Tabulator constructor so i can help you out.

Cheers

Oli

If you can post the line of your column definition array that includes the tick box (you can change the field and title in the definition if privacy is a concern) then i can help you out.

Ok,
Here's a typical 'tickCross' line out of my column definition array:

{title:"CheckBox", field:"field12", sortable: true, sorter: "number", editor: "tick", align: "center", formatter: "tickCross", responsive: 1},

Hey,

In this case i would actually recommend a different approach to make the editing a smoother experience.

I would recommend that you don't use an editor but instead use the cellClick function and the getValue and setValue functions on the cell component:

{title:"CheckBox", field:"field12", sortable: true, sorter: "number", align: "center", formatter: "tickCross", responsive: 1, cellClick:function(e, cell){
    cell.setValue(!cell.getValue());
}},

Let me know if that helps

Cheers

Oli

Was this page helpful?
5 / 5 - 1 ratings