Sort arrow is in wrong column in reports
This commit is contained in:
parent
9f415ccbc5
commit
2c5422fdd5
|
|
@ -335,6 +335,7 @@ class AppDataTable extends StatelessWidget {
|
|||
this.columnSpacing = 56.0,
|
||||
this.showCheckboxColumn = true,
|
||||
this.dividerThickness = 1.0,
|
||||
this.hasActionsColumn = false,
|
||||
@required this.rows,
|
||||
}) : assert(columns != null),
|
||||
assert(columns.isNotEmpty),
|
||||
|
|
@ -437,6 +438,8 @@ class AppDataTable extends StatelessWidget {
|
|||
// non-numeric, if there is exactly one, otherwise null.
|
||||
final int _onlyTextColumn;
|
||||
|
||||
final bool hasActionsColumn;
|
||||
|
||||
static int _initOnlyTextColumn(List<DataColumn> columns) {
|
||||
int result;
|
||||
for (int index = 0; index < columns.length; index += 1) {
|
||||
|
|
@ -757,7 +760,7 @@ class AppDataTable extends StatelessWidget {
|
|||
sortColumnIndex != dataColumnIndex || !sortAscending)
|
||||
: null,
|
||||
// IGNORE SORTING ON FIRST COLUMN
|
||||
sorted: displayCheckboxColumn
|
||||
sorted: displayCheckboxColumn || !hasActionsColumn
|
||||
? dataColumnIndex == sortColumnIndex
|
||||
: (dataColumnIndex - 1) == sortColumnIndex,
|
||||
ascending: sortAscending,
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ class AppPaginatedDataTable extends StatefulWidget {
|
|||
this.onPageChanged,
|
||||
this.rowsPerPage = defaultRowsPerPage,
|
||||
this.subtractOneFromCount = false,
|
||||
this.hasActionsColumn = false,
|
||||
this.availableRowsPerPage = const <int>[
|
||||
defaultRowsPerPage,
|
||||
defaultRowsPerPage * 2,
|
||||
|
|
@ -216,6 +217,7 @@ class AppPaginatedDataTable extends StatefulWidget {
|
|||
final DragStartBehavior dragStartBehavior;
|
||||
|
||||
final bool subtractOneFromCount;
|
||||
final bool hasActionsColumn;
|
||||
|
||||
@override
|
||||
AppPaginatedDataTableState createState() => AppPaginatedDataTableState();
|
||||
|
|
@ -498,6 +500,7 @@ class AppPaginatedDataTableState extends State<AppPaginatedDataTable> {
|
|||
columnSpacing: widget.columnSpacing,
|
||||
showCheckboxColumn: widget.showCheckboxColumn,
|
||||
rows: _getRows(_firstRowIndex, widget.rowsPerPage),
|
||||
hasActionsColumn: widget.hasActionsColumn,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -235,6 +235,7 @@ class _EntityListState extends State<EntityList> {
|
|||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 16),
|
||||
child: AppPaginatedDataTable(
|
||||
hasActionsColumn: true,
|
||||
onSelectAll: (value) {
|
||||
final startIndex =
|
||||
min(_firstRowIndex, entityList.length - 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue