@@ -50,7 +50,13 @@ Item {
5050
5151 BetterLabel {
5252 anchors .centerIn : parent
53- text: modelData
53+ text: {
54+ if (modelData === " rowNumber" ) {
55+ return " #" ;
56+ } else {
57+ return modelData
58+ }
59+ }
5460 color: sysPalette .windowText
5561 }
5662
@@ -183,6 +189,7 @@ Item {
183189 reuseItems: false
184190 model: searchModel ? searchModel : null
185191
192+ // Proxy model row index from 0 to maxItemsOnPage
186193 property int currentRow: - 1
187194 property var searchField
188195 property var currentStart: 0
@@ -266,14 +273,18 @@ Item {
266273 DelegateChoice {
267274 column: 0
268275
276+
277+ // NOTE: rowNumber - key model zero based index from 0 to rowsCount
278+ // NOTE: row - from 0 to pageSize
279+
269280 ValueTableCell {
270281 objectName: " rdm_value_table_cell_col1"
271282 implicitWidth: table .firstColumnWidth
272283 implicitHeight: 30
273- text: Number (row ) + 1
274- selected: table .model . getOriginalRowIndex ( table . currentRow ) === row
284+ text: Number (rowNumber ) + 1
285+ selected: table .currentRow === row
275286 onClicked: {
276- table .currentRow = table . model . getProxyRowIndex ( row)
287+ table .currentRow = row
277288 table .forceActiveFocus ()
278289 }
279290 }
@@ -287,12 +298,9 @@ Item {
287298 implicitWidth: table .valueColumnWidth
288299 implicitHeight: 30
289300 text: renderText (display)
290- selected: table .model . getOriginalRowIndex ( table . currentRow ) === row
301+ selected: table .currentRow === row
291302 onClicked: {
292- table .currentRow = table .model .getProxyRowIndex (row)
293-
294- console .log (table .model .getProxyRowIndex (row), row)
295-
303+ table .currentRow = row
296304 table .forceActiveFocus ()
297305 }
298306 }
@@ -306,9 +314,9 @@ Item {
306314 implicitWidth: table .valueColumnWidth
307315 implicitHeight: 30
308316
309- selected: table .model . getOriginalRowIndex ( table . currentRow ) === row
317+ selected: table .currentRow === row
310318 onClicked: {
311- table .currentRow = table . model . getProxyRowIndex ( row)
319+ table .currentRow = row
312320 table .forceActiveFocus ()
313321 }
314322
@@ -430,7 +438,7 @@ Item {
430438 onCurrentRowChanged: {
431439 console .log (" Current row in table changed: " , currentRow)
432440 if (currentRow >= 0 ) {
433- valueEditor .loadRowValue (table .model .getOriginalRowIndex (currentRow))
441+ valueEditor .loadRowValue (currentStart + table .model .getOriginalRowIndex (currentRow))
434442 }
435443 }
436444 }
0 commit comments