As I understood, you want some, let’s say, “virtual” grid column which will not exist in schema but will be displayed in a grid and will represent rows numeration ?
If you want numeration only per page (without taking into account grid’s pagination) and only for particular grid, it can be done on frontend side, so declare new column in yours datagrid.yml
1
2
3
4
5
6
7
8
9
10
datagrid:
my-grid:
...
columns:
numeration:
label:'Order'
...
do not add anything into ‘filters’ and ‘sorters’ for such column, because you will not be able to sort or filter. You also can set ‘type: twig’ and define ‘template’ for your numeration column, where you can provide some markup for numbers (if needed). So, this will add new empty column (<td>) into grid.
//iterate through $(el).find('tbody tr > td:first-child')
//and set your row numbers
})
// the same for grid's 'reset' and 'refresh' actions
});
});
</script>
Not the best solution, i think, but pretty fast one ;) But if you want continuous numbering through all grid’s pages – this should be done in backend and will be more complex.
P.S. Thanks for the good question. It looks like improvement for our grids. Will investigate it.
Author
Replies
Viewing 1 replies (of 1 total)
The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.
We collect cookie information with a goal to provide you with the best user experience. By using this website, you agree to our use of cookies. Read Oro Inc.’s Cookie policy.
We collect cookie information with a goal to provide you with the best user experience. By using this website, you agree to our use of cookies. Read Oro Inc.’s Cookie policy.