Bootstrap datatable fixed column


#1

Does anyone have fixed columns working with the datatable?
Referring to the Appstudio sample, i changed the updateTable() to have…

DataTable1.settings.columns = columns1
DataTable1.settings.scrollY = “600px”
DataTable1.settings.scrollX = True
DataTable1.settings.scrollCollapse = True
DataTable1.settings.paging = False
DataTable1.settings.fixedColumns = True
DataTable1.settings.fixedColumns = { leftColumns: 1, rightColumns: 0 }
DataTable1.settings.data = data1
DataTable1.build()

And i’ve tried a number of other examples i’ve seen only, but just can’t get it to work.

Thanks


#2

Do you mean this?

https://datatables.net/extensions/fixedcolumns/

The libraries for this are not currently included in AppStudio.


#3

Yes, that is it. I need to fix the left column.

Is there any way to add this library into AppStudio now?

Thanks


#4

Can the libraries be added in the next build?

Thanks


#5

We’re reluctant to add this library to the default DataTable which comes with AppStudio. It adds size and complexity.

It is important to state up front that utilising FixedColumns in your DataTable can significantly increase the complexity of the table and its use should not be undertaken lightly, particularly for complex tables. The reason for this is in how FixedColumns operates - the fixed columns are actually separate tables from the original DataTable (i.e. they are separate table elements) which are styled to look like they are visually part of the original table. These fixed tables are then positioned over the original DataTable.

https://datatables.net/extensions/fixedcolumns/

The easiest way to include the FixedColumn library is to add it into the extraheaders property of your project. Here an example of loading it via CDN:

<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/fc-3.2.5/datatables.min.css"/>
 
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/fc-3.2.5/datatables.min.js"></script>

(from https://datatables.net/download/)


#6

Thanks. The datatable can now meet all my requirements.
Are there any other ramifications for adding this in our projects?
I hope it won’t cause problems in the future.


#7

I don’t know of any issues beyond what Datatables documents.