I have added a button in pimcore panel in object editor. On button click how can I fetch selected records from the table?
Table:

So far I have tried this:
postOpenObject: function (object, type) {
object.toolbar.add({
iconCls: 'pimcore_icon_export',
scale: 'small',
handler: function () {
const req = new XMLHttpRequest();
// I need to pass selected items in a function
req.open("GET", '/admin/export-xyz/', true);
}.bind(this, object)
});
pimcore.layout.refresh();
},