Retrieving the selected row data in a mdbeditor modal


Topic: Retrieving the selected row data in a mdbeditor modal

darrenh65 pro premium asked 4 years ago

The expected behaviour is the delete modal will open with the required field value displayed on it

I have been unable to find a way to make this work. The snippet behaves somewhat differently to my system. On mine development system the value that is returned is always from the first row regardless of which row is selected. On the snippet it does not work at all and I don't know why.

Am I going the wrong way to retrieve the selected record?

I have created a snippet containing js for the show.bs.modal event. I have tried several methods but this is the one I thought was most likely to work. https://mdbootstrap.com/snippets/jquery/darrenh65/2800576


Marcin Luczak staff answered 4 years ago

Hi @darrenh65,

You were very close to finding a solution for your case. Our datatable rows have tr-color-selected class added on the selection and this is how you can retrieve the desired row. Please see my snippet with the solution: https://mdbootstrap.com/snippets/jquery/marcin-luczak/2801525

Regards, Marcin


darrenh65 pro premium answered 4 years ago

Thanks Marcin, The solution works perfectly.

regards, Darren


Marcin Luczak staff commented 4 years ago

I am happy that I could help,

Regards, Marcin


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
  • User: Pro
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: 4.19.1
  • Device: pc
  • Browser: Chrome/Firefox
  • OS: Linux/win10
  • Provided sample code: No
  • Provided link: Yes
Tags