I'm currently using the aui library to create a sortable datatable. I want the cells to be selectable without any javascript event binding.
Here is how my columns
are defined:
var columns = [
{
key: "col1",
label: "Column 1",
sortable: true
},
{
key: "col2",
label: "Column 2",
sortable: true
},
...
];
When I initialize the datatable with:
var myDatatable = new A.DataTable.Base({
columnset : columns,
recordset : data
});
I can select rows individually but sorting doesn't work.
However, if I use:
var myDatatable = new A.DataTable({
columnset : columns,
recordset : data
});
The table becomes sortable but I lose the ability to select the data by simply clicking and dragging the mouse.
I've tried adding these plugins:
plugins: [{
cfg: {
type: "rows"
},
fn: A.Plugin.DataTableHighlight
},
{
cfg: {
selectRow: true,
selectColumn: true
},
fn: A.Plugin.DataTableSelection
}]
However, I still can't achieve a plain simple selection. You can check the aui documentation here. The basic example covers most of my needs except for sorting, and in the real-world example, double-clicking (for editing) is required to select/copy the cell contents.
Please assist. Thank you!