-
This is a set of mock data to mention, if I want to add more fields and display them, is there any way, for example: {key: '0', text: 'Aayla Secura', url: 'https://wwww.com'} When retrieved, it will appear as Aayla Secura and be linked to the URL const MENTIONABLES: TComboboxItem[] = [
{ key: '0', text: 'Aayla Secura'},
{ key: '1', text: 'Adi Gallia' },
{
key: '2',
text: 'Admiral Dodd Rancit'
},
{
key: '3',
text: 'Admiral Firmus Piett'
},
{
key: '4',
text: 'Admiral Gial Ackbar'
},
{ key: '5', text: 'Admiral Ozzel' },
{ key: '6', text: 'Admiral Raddus' },
{
key: '7',
text: 'Admiral Terrinald Screed'
},
{ key: '8', text: 'Admiral Trench' },
{
key: '9',
text: 'Admiral U.O. Statura'
},
{ key: '10', text: 'Agen Kolar' },
{ key: '11', text: 'Agent Kallus' },
{
key: '12',
text: 'Aiolin and Morit Astarte'
},
{ key: '13', text: 'Aks Moe' },
{ key: '14', text: 'Almec' },
{ key: '15', text: 'Alton Kastle' },
{ key: '16', text: 'Amee' },
{ key: '17', text: 'AP-5' },
{ key: '18', text: 'Armitage Hux' },
{ key: '19', text: 'Artoo' },
{ key: '20', text: 'Arvel Crynyd' },
{ key: '21', text: 'Asajj Ventress' },
{ key: '22', text: 'Aurra Sing' },
{ key: '23', text: 'AZI-3' },
{ key: '24', text: 'Bala-Tik' },
{ key: '25', text: 'Barada' },
{ key: '26', text: 'Bargwill Tomder' },
{ key: '27', text: 'Baron Papanoida' },
{ key: '28', text: 'Barriss Offee' },
{ key: '29', text: 'Baze Malbus' },
{ key: '30', text: 'Bazine Netal' },
{ key: '31', text: 'BB-8' },
{ key: '32', text: 'BB-9E' },
{ key: '33', text: 'Ben Quadinaros' },
{ key: '34', text: 'Berch Teller' },
{ key: '35', text: 'Beru Lars' },
{ key: '36', text: 'Bib Fortuna' },
{
key: '37',
text: 'Biggs Darklighter'
},
{ key: '38', text: 'Black Krrsantan' },
{ key: '39', text: 'Bo-Katan Kryze' },
{ key: '40', text: 'Boba Fett' },
{ key: '41', text: 'Bobbajo' },
{ key: '42', text: 'Bodhi Rook' },
{ key: '43', text: 'Borvo the Hutt' },
{ key: '44', text: 'Boss Nass' },
{ key: '45', text: 'Bossk' },
{
key: '46',
text: 'Breha Antilles-Organa'
},
{ key: '47', text: 'Bren Derlin' },
{ key: '48', text: 'Brendol Hux' },
{ key: '49', text: 'BT-1' },
{ key: '50', text: 'C-3PO' }
] |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
For example, when I look up Aayla Secura, and its value is' {key: '0', text: 'Aayla Secura', url: 'https://www.xxx.com'} ', I want the mention to take me to this URL |
Beta Was this translation helpful? Give feedback.
-
A entire rework is coming soon #3168 |
Beta Was this translation helpful? Give feedback.
-
Hello @kjhuanhao I had to perform tasks like calling a popup according to the unique code value linked to the mention when the mentioned part was clicked. However, the connected data only held text values, which was a dilemma for me. It would be great if this could be improved in the next version, but for now, I used a bit of a workaround. Assuming that I directly created the "MENTIONABLES" data, I combined the desired values in the text. In my case, I combined userName and userID like this: [userName/userID]. Then, in the mention-combobox, I used onRenderItem to split and process the part that is actually displayed. onRenderItem={(props: ComboboxItemProps) => ( {props.item.text.split('/')[0]}
)}
Additionally, I customized the onClick event of the MentionElement in plugins to get the desired result.
For now, I was able to handle it temporarily this way. |
Beta Was this translation helpful? Give feedback.
A entire rework is coming soon #3168