Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QTable bottom-left slot #7208

Open
aleksander237 opened this issue Jun 12, 2020 · 6 comments
Open

QTable bottom-left slot #7208

aleksander237 opened this issue Jun 12, 2020 · 6 comments

Comments

@aleksander237
Copy link

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
There is this extra space on the bottom left of the QTable component. I know it is used for showing numbers of selected records, but maybe it could be used for seomething else when no records are selected. There is the "general" bottom slot but when used it overwrites pagination.

Describe alternatives you've considered
Just use bottom slot

@matejmohar
Copy link
Contributor

Hi Quasar team,
is there any chance that this will be implemented in (near?) future? It would really speed up development when using QTable.

I would create a PR and try to help you, but I don't have enough knowledge to do this. :(

Thanks!

@bakbluelabel
Copy link

Yes, I need this feature as well. To show message on the table bottom (left) while co-exist with pagination on the right. Currently if using <template v-slot:bottom>, the pagination disappear 😞 ...

@downace
Copy link

downace commented Aug 19, 2022

I've solved this issue in my project by adding new bottom-left slot:

Patch
Index: ui/src/components/table/QTable.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ui/src/components/table/QTable.js b/ui/src/components/table/QTable.js
--- a/ui/src/components/table/QTable.js	(revision f2a136118468d8c26c0279d5309b31dc2434b3eb)
+++ b/ui/src/components/table/QTable.js	(date 1660879268786)
@@ -763,15 +763,19 @@
         return h('div', { class: bottomClass }, [ bottom(marginalsScope.value) ])
       }
 
-      const child = props.hideSelectedBanner !== true && hasSelectionMode.value === true && rowsSelectedNumber.value > 0
-        ? [
-            h('div', { class: 'q-table__control' }, [
-              h('div', [
-                (props.selectedRowsLabel || $q.lang.table.selectedRecords)(rowsSelectedNumber.value)
-              ])
-            ])
-          ]
-        : []
+      const bottomLeft = slots[ 'bottom-left' ]
+
+      const child = [];
+
+      if (bottomLeft !== void 0) {
+        child.push(h('div', { class: 'q-table__control' }, [ bottomLeft(marginalsScope.value) ]))
+      } else if (props.hideSelectedBanner !== true && hasSelectionMode.value === true && rowsSelectedNumber.value > 0) {
+        child.push(h('div', { class: 'q-table__control' }, [
+          h('div', [
+            (props.selectedRowsLabel || $q.lang.table.selectedRecords)(rowsSelectedNumber.value)
+          ])
+        ]))
+      }
 
       if (props.hidePagination !== true) {
         return h('div', {
Index: ui/src/components/table/QTable.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ui/src/components/table/QTable.json b/ui/src/components/table/QTable.json
--- a/ui/src/components/table/QTable.json	(revision f2a136118468d8c26c0279d5309b31dc2434b3eb)
+++ b/ui/src/components/table/QTable.json	(date 1660880342202)
@@ -1349,6 +1349,16 @@
       }
     },
 
+    "bottom-left": {
+      "desc": "Bottom left slot",
+      "scope": {
+        "cols": {
+          "type": "Object",
+          "desc": "Column definitions",
+          "__exemption": [ "examples" ]
+        }
+      }
+    },
     "bottom-row": {
       "desc": "Slot to define how bottom extra row looks like",
       "scope": {

Maybe it will be useful for someone.

UPD: Using yarn patch feature to apply these changes to my project's Quasar instance.

sainf added a commit to sainf/quasar that referenced this issue Nov 10, 2022
@asdrubalp9
Copy link

I've solved this issue in my project by adding new bottom-left slot:

Patch

Index: ui/src/components/table/QTable.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ui/src/components/table/QTable.js b/ui/src/components/table/QTable.js
--- a/ui/src/components/table/QTable.js	(revision f2a136118468d8c26c0279d5309b31dc2434b3eb)
+++ b/ui/src/components/table/QTable.js	(date 1660879268786)
@@ -763,15 +763,19 @@
         return h('div', { class: bottomClass }, [ bottom(marginalsScope.value) ])
       }
 
-      const child = props.hideSelectedBanner !== true && hasSelectionMode.value === true && rowsSelectedNumber.value > 0
-        ? [
-            h('div', { class: 'q-table__control' }, [
-              h('div', [
-                (props.selectedRowsLabel || $q.lang.table.selectedRecords)(rowsSelectedNumber.value)
-              ])
-            ])
-          ]
-        : []
+      const bottomLeft = slots[ 'bottom-left' ]
+
+      const child = [];
+
+      if (bottomLeft !== void 0) {
+        child.push(h('div', { class: 'q-table__control' }, [ bottomLeft(marginalsScope.value) ]))
+      } else if (props.hideSelectedBanner !== true && hasSelectionMode.value === true && rowsSelectedNumber.value > 0) {
+        child.push(h('div', { class: 'q-table__control' }, [
+          h('div', [
+            (props.selectedRowsLabel || $q.lang.table.selectedRecords)(rowsSelectedNumber.value)
+          ])
+        ]))
+      }
 
       if (props.hidePagination !== true) {
         return h('div', {
Index: ui/src/components/table/QTable.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ui/src/components/table/QTable.json b/ui/src/components/table/QTable.json
--- a/ui/src/components/table/QTable.json	(revision f2a136118468d8c26c0279d5309b31dc2434b3eb)
+++ b/ui/src/components/table/QTable.json	(date 1660880342202)
@@ -1349,6 +1349,16 @@
       }
     },
 
+    "bottom-left": {
+      "desc": "Bottom left slot",
+      "scope": {
+        "cols": {
+          "type": "Object",
+          "desc": "Column definitions",
+          "__exemption": [ "examples" ]
+        }
+      }
+    },
     "bottom-row": {
       "desc": "Slot to define how bottom extra row looks like",
       "scope": {

Maybe it will be useful for someone.

was this turned into a pull request to add it to the framework?

@sainf
Copy link

sainf commented Nov 23, 2022

Hi, asdrubalp9.

Following the issues guides, downace made an discussion, please upvote it!

I also need the bottom left slot so i'm keeping a updated fork.

@Miosss
Copy link

Miosss commented Jul 31, 2024

This would be very helpfull and it doesn't seem like huge change.
Maybe just bottom-center slot to make use of the empty space between selection summary and pagination?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants