bosskmk / pluto_grid

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
637 stars 291 forks source link

[Help] - How to get the current ordered list #930

Closed wer-mathurin closed 10 months ago

wer-mathurin commented 10 months ago

When using a renderer on a PlutoColumn when sorting is applied, how do we get the current ordered list ? Otherwise the bellow code will render the items from the original list...

...
renderer: (rendererContext) {

              return Text(
                  items[rendererContext.rowIdx].product.description,
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis);
            },
wer-mathurin commented 10 months ago

Finally just understand the principle. In the renderer you need to work with the cell value

 renderer: (rendererContext) {
              return Text(rendererContext.cell.value,
                  maxLines: 2, overflow: TextOverflow.ellipsis);
            },