File tree Expand file tree Collapse file tree
demo-common/src/commonMain/kotlin/com/seanproctor/datatable/demo Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,14 +104,14 @@ fun App(onRowClick: (Int) -> Unit) {
104104 } else {
105105 LazyPaginatedDataTable (
106106 columns = columns,
107- state = rememberPaginatedDataTableState(5 ),
107+ state = rememberPaginatedDataTableState(initialPageSize = 5 , initialCount = sortedData.size ),
108108 sortColumnIndex = sortColumnIndex,
109109 sortAscending = sortAscending,
110110 modifier = Modifier .fillMaxWidth().padding(16 .dp),
111111 logger = { println (it) },
112112 fetchPage = { state ->
113113 val fromIndex = state.pageIndex * state.pageSize
114- val toIndex = min(fromIndex + state.pageSize, state.count - 1 )
114+ val toIndex = min(fromIndex + state.pageSize, sortedData.size )
115115 val subset = sortedData.subList(fromIndex, toIndex)
116116 subset.forEachIndexed { index, rowData ->
117117 row {
@@ -160,4 +160,4 @@ fun DataTableScope.generateTable(data: List<DemoData>, onRowClick: (Int) -> Unit
160160 }
161161}
162162
163- data class DemoData (val value : Float , val text : String )
163+ data class DemoData (val value : Float , val text : String )
You can’t perform that action at this time.
0 commit comments