Freeze A Row of Data
Freeze A Row of Data
DarioAustralia
Posts: 4Questions: 2Answers: 0
Is there a way to freeze the first row of data, so that it won't be sorted when a column heading is clicked ? Here is an example of when that could be useful :
Prediction Method | Error Rate | Accuracy |
---|---|---|
Ideal | 0 | 1 |
SVM | 0.21 | 0.88 |
ANN | 0.28 | 0.84 |
LDA | 0.33 | 0.74 |
No matter what column I sort on, I'd like the Ideal row to always be at the top of the table.
This discussion has been closed.
Answers
You would need to create a custom sorting plug-in that will always put that row at the top. The other option is to do an DOM injection in the draw callback, but that has its own complications (FixedColumns for example simply will not work with it)!
Allan
I'm not sure that I could achieve that. I'm using the DT R package as an interface to DataTables and I haven't programmed with JavaScript before. I think that I can go without the feature.