<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ZingGrid Demo</title> <link href="https://cdn.jsdelivr.net/npm/emoji-js@3.8.0/lib/emoji.min.css" rel="stylesheet"> <script nonce="undefined" src="https://cdn.jsdelivr.net/npm/emoji-js@3.8.0/lib/emoji.min.js"></script> <script nonce="undefined" src="https://cdn.zinggrid.com/zinggrid.min.js"></script> <style> zing-grid[loading] { height: nullpx; } </style> </head> <body> <h3>[type-emoji-shortcode] sets the function used to convert the shortcodes to emojis.</h3> <p>For this demo, we are using emoji-js.</p> <zing-grid data='[ { "text": "U+1F98A", "type": "codepoint", "emoji": "U+1F98A" }, { "text": "🐈⬛", "type": "emoji", "emoji": "🐈⬛" }, { "text": ":leopard:", "type": "shortcode", "emoji": ":leopard:" }, { "text": "Hello there :wave:, bye! U+1F60E 👍", "type": "text with different emoji formats", "emoji": "Hello there :wave:, bye! U+1F60E 👍" } ]'> <zg-colgroup> <zg-column index="text"></zg-column> <zg-column index="type"></zg-column> <zg-column index="emoji" type="emoji" type-emoji-shortcode="shortcodeConverter"></zg-column> </zg-colgroup> </zing-grid> <script> ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']); let emojiConverter = new EmojiConvertor(); function shortcodeConverter(txt) { return emojiConverter.replace_colons(txt); }; ZingGrid.registerMethod(shortcodeConverter, 'shortcodeConverter'); </script> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>ZingGrid Demo</title> <link href="https://cdn.jsdelivr.net/npm/emoji-js@3.8.0/lib/emoji.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/emoji-js@3.8.0/lib/emoji.min.js"></script> <script src="https://cdn.zinggrid.com/zinggrid.min.js"></script> </head> <body> <h3>[type-emoji-shortcode] sets the function used to convert the shortcodes to emojis.</h3> <p>For this demo, we are using emoji-js.</p> <zing-grid data='[ { "text": "U+1F98A", "type": "codepoint", "emoji": "U+1F98A" }, { "text": "🐈⬛", "type": "emoji", "emoji": "🐈⬛" }, { "text": ":leopard:", "type": "shortcode", "emoji": ":leopard:" }, { "text": "Hello there :wave:, bye! U+1F60E 👍", "type": "text with different emoji formats", "emoji": "Hello there :wave:, bye! U+1F60E 👍" } ]'> <zg-colgroup> <zg-column index="text"></zg-column> <zg-column index="type"></zg-column> <zg-column index="emoji" type="emoji" type-emoji-shortcode="shortcodeConverter"></zg-column> </zg-colgroup> </zing-grid> </body> </html>
let emojiConverter = new EmojiConvertor(); function shortcodeConverter(txt) { return emojiConverter.replace_colons(txt); }; ZingGrid.registerMethod(shortcodeConverter, 'shortcodeConverter');