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

    How to pass QTable props to a method(a function) on @click

    Help
    2
    2
    1397
    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.
    • N
      ND last edited by

      I am trying to access table prop on click using @click but its now working. Please give me suggestion. Thank you.
      Here is sample code that i was trying.
      <q-table
      :data=“outcome”
      title=“Customer Data”
      :columns=“constant.columns”
      row-key=“constant.name”
      selection=“multiple”
      :selected.sync=“selected”
      :pagination.sync=“pagination”

      <template slot=“body” slot-scope=“props”>
      <q-tr :props=“props”>
      <q-td key=“actions” :props=“props” >
      <q-btn size=“sm” :props=“props” outline color=“secondary” icon=“send” class=“q-mr-xs” @click=“playAudio(props.row.recordingUrl)” >
      </q-btn>
      </q-td>
      </q-tr>
      </template>

      </q-table>

      and the function under methods:

      methods: {
      playAudio: function(audioUrl){
      console.log("Audio Url is : – ", audioUrl);
      const audio = new Audio(‘audioUrl’);
      audio.play();
      }
      }

      here i am trying to access audio URL and it says undefined in console

      1 Reply Last reply Reply Quote 0
      • M
        Max last edited by

        have you really read http://quasar-framework.org/components/datatable.html ? its all in there! please always check docs!

        1 Reply Last reply Reply Quote -4
        • First post
          Last post