No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Data table

    Framework
    6
    9
    1742
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      snezhkois last edited by

      Hi. Can you tell me please. I can not place action buttons (edit, delete) on each rows?

      1 Reply Last reply Reply Quote 0
      • benoitranque
        benoitranque last edited by

        You must use slots. Can you please post code showing what you have tried?

        S 1 Reply Last reply Reply Quote 0
        • S
          snezhkois @benoitranque last edited by

          @benoitranque

                         <q-data-table
                                      :data="items"
                                      :config="{}"
                                      :columns="[
                                          {
                                              label: 'Commission (%)',
                                              field: 'commission'
                                          },
                                          {
                                              label: 'From',
                                              field: 'wallet',
                                              format (value, row) {
                                                  return '<b>' + value.data.paymentSystem.data.name + ', ' + value.data.prefix + '</b>' + ' ' + (value.data.account.length > 25 ? value.data.account.substring(0, 25) + '...' : value.data.account)
                                              }
                                          },
                                          {
                                              label: 'To',
                                              field: 'paymentSystem',
                                              format (value, row) {
                                                  return '<b>' + value.data.name
                                              }
                                          },
                                          {
                                              label: 'Currency',
                                              field: 'prefix'
                                          }
                                      ]"
                              >
                                  <!-- Custom renderer for "source" column -->
                                  <template slot="col-source" scope="cell">
                                      {{cell.data}}
                                  </template>
                                  <!-- Custom renderer for "action" column with button for custom action -->
                                  <template slot="col-action" scope="cell">
                                      <q-btn color="primary" @click="goToEditCommission(cell)">Edit</q-btn>
                                      <q-btn color="primary" @click="openDeleteDialog(cell)">Delete</q-btn>
                                  </template>
                              </q-data-table>
          
          

          result (no actions)
          0_1516796089710_2018-01-24_15-14-13.png

          1 Reply Last reply Reply Quote 0
          • benoitranque
            benoitranque last edited by

            You do not have an action column, so there is no col-action slot. Add this item to your column definition:

            {
              label: '',
              field: 'action'
            }
            

            It does not matter if your data does not contain an action field

            S 1 Reply Last reply Reply Quote 0
            • S
              snezhkois @benoitranque last edited by

              @benoitranque

              thanks! i can not find this in documentation …

              1 Reply Last reply Reply Quote 0
              • D
                darksiege23 last edited by

                is this working on version 15.?

                1 Reply Last reply Reply Quote 0
                • I
                  iober last edited by

                  does anyone have an answer for that?

                  1 Reply Last reply Reply Quote 0
                  • s.molinari
                    s.molinari last edited by

                    @iober - This is a very old thread. You will probably be better off starting a new one describing your problem, possibly referencing this one. However, this was for a very old version of Quasar and is no longer valid either.

                    Scott

                    1 Reply Last reply Reply Quote 0
                    • Pratik Patel
                      Pratik Patel last edited by Pratik Patel

                      Please refer the following codepen @iober .

                      https://codepen.io/Pratik__007/pen/eYNvvva?editors=1010

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post