英文:
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"},
//...
],
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},
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论