Topic: MDBDatatable event "selected-rows"

hkrhee priority asked 2 years ago


MDBDatatable > API > Event "selected-rows"
The API's description said "This event fires when a user selects rows with checkboxes. It returns an array of selected rows."

I registered the 'selected-rows' event in MDBDatatable element, but couldn't find a way to get the data returns an array of selected rows. Can you tell me how to get the return data?


alana_vue free commented 2 years ago

Hi, I just find a way to get the data on my project. Just add to the datatable the event selected-rows and call a function as follow:

  <MDBDatatable
    :dataset="dataset1"
    :hover="true"
     selectable
    multi
    @selected-rows="getSelectedRows"
  />

const getSelectedRows = index => { console.log(index)

  };

I hope this helps


Mikołaj Smoleński staff commented 2 years ago

@hkrhee did @alana_vue advice solve the problem?


hkrhee priority commented 2 years ago

@alana_vue , @Mikołaj Smoleński It works very well. Thank you so much!



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Vue
  • MDB Version: MDB5 1.4.0
  • Device: PC
  • Browser: Chrome
  • OS: Window 10
  • Provided sample code: No
  • Provided link: No