Transfer Plugin Methods


Topic: Transfer Plugin Methods

jseird pro premium priority asked 6 days ago

As it seems not to be documented: How could we retrieve an array of the target side out of the transfer plugin? Assuming the source side gets the following array:

const data1 = [
  {
    data: 'Lorem ipsum',
    id:100
  },
  {
    data: 'Something special',
    disabled: true,
    id:333
  }]

Then I transfer the fist data1 entry with id=100 to the right side. How could I retrieve the corresponding array of the transfer plugin?

Thanks


Grzegorz Bujański staff answered 5 days ago

At the moment there is no special method to retrieve this data. I will add this to our list of ideas. For now, you can check it like this:

const transferEl = document.getElementById('mdb-transfer');
const instance = Transfer.getInstance(transferEl);

const source = instance._dataSource;
const target = instance._dataTarget;

jseird pro premium priority commented 5 days ago

Ok - thank you. Also it would be great if we can pass custom variables in addition to the visible strings in those data arrays. Actually the only comparison could be driven via strings.


Please insert min. 20 characters.
Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: MDB 5
  • MDB Version: 3.2.0
  • Device: all
  • Browser: all
  • OS: all
  • Provided sample code: No
  • Provided link: No