From 4696c49b857912d2460cf278d910c529ea10e418 Mon Sep 17 00:00:00 2001 From: Doljinsuren Enkhbayar Date: Thu, 16 May 2024 11:50:16 +0800 Subject: [PATCH 1/2] added selection --- addon/controllers/users/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addon/controllers/users/index.js b/addon/controllers/users/index.js index 8e2a978..36c4a97 100644 --- a/addon/controllers/users/index.js +++ b/addon/controllers/users/index.js @@ -266,7 +266,8 @@ export default class UsersIndexController extends Controller { * @void */ @action exportUsers() { - this.crud.export('user'); + const selections = this.table.selectedRows.map((_) => _.id); + this.crud.export('user', { params: { selections } }); } /** From 9c046cd3bccfb60eda315a6f485166faabb8e46b Mon Sep 17 00:00:00 2001 From: Doljinsuren Enkhbayar Date: Fri, 17 May 2024 10:59:05 +0800 Subject: [PATCH 2/2] fix url --- addon/controllers/users/index.js | 2 +- addon/templates/users/index.hbs | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/addon/controllers/users/index.js b/addon/controllers/users/index.js index 36c4a97..6220e20 100644 --- a/addon/controllers/users/index.js +++ b/addon/controllers/users/index.js @@ -267,7 +267,7 @@ export default class UsersIndexController extends Controller { */ @action exportUsers() { const selections = this.table.selectedRows.map((_) => _.id); - this.crud.export('user', { params: { selections } }); + this.crud.export('users', { params: { selections } }); } /** diff --git a/addon/templates/users/index.hbs b/addon/templates/users/index.hbs index c005f59..a714cce 100644 --- a/addon/templates/users/index.hbs +++ b/addon/templates/users/index.hbs @@ -1,5 +1,5 @@ - {{#if (safe-has this.table "selectedRows")}} + {{#if (safe-has this.table "selectedRows")}}
@@ -15,7 +15,19 @@ - +
{{outlet}} \ No newline at end of file