Tabulator可选择和rowSelection列定义

huangapple go评论110阅读模式
英文:

Tabulator Selectable and rowSelection column definition

问题

I am using Tabulator and want to allow the end-user to only select one row. I used the Selectable:1 property without issue. However, visually I want to show the user which row since the current select row highlight is insufficient, so I decided to see if I could add a checkmark to confirm that a specific row is indeed selected. Reviewing the documentation shows a formatter called "rowSelection". I added this and it works. However, the header of the rowSelection column has a checkbox (assuming for select all/deselect all), which is enabled. Is there any way to disable this since the end user can only select one row in this case? The workflow is that the user selects a table row and clicks on the View Only, Update or Delete buttons already in place outside of Tabulator.

columns:[	// define the table columns
    {formatter:"rowSelection", titleFormatter:"rowSelection", align:"center", headerSort:false},
    {title:"Period", field:"submissionPeriod"},
    //...
],

And just an FYI, the header Checkmark is not Center aligned (it is left aligned).

英文:

I am using Tabulator and want to allow the end-user to only select one row. I used the Selectable:1 property without issue. However, visually I want to show the user which row since the current select row highlight is insufficient, so I decided to see if I could add a checkmark to confirm that a specific row is indeed selected. Reviewing the documentation shows a formatter called "rowSelection". I added this and it works. However, the header of the rowSelection column has a checkbox (assuming for select all/deselect all), which is enabled. Is there any way to disable this since the end user can only select one row in this case? The workflow is that the user selects a table row and clicks on the View Only, Update or Delete buttons already in place outside of Tabulator.

columns:[	// define the table columns
    {formatter:"rowSelection", titleFormatter:"rowSelection", align:"center", headerSort:false},
    {title:"Period", field:"submissionPeriod"},
    //...
],

Tabulator可选择和rowSelection列定义

And just an FYI, the header Checkmark is not Center aligned (it is left aligned).

答案1

得分: 2

如果您不想在列标题中显示复选框,则不需要在列构造函数中指定titleFormatter:

{formatter:"rowSelection", align:"center", headerSort:false},

英文:

If you don't want the checkbox in the column header, the you don't need to specify the titleFormatter in the column constructor:

{formatter:"rowSelection", align:"center", headerSort:false},

huangapple
  • 本文由 发表于 2020年1月7日 00:55:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/59616039.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定