Widget: DCTList: Difference between revisions

From LINKS Community Center
Jump to: navigation, search
Eschmidt (talk | contribs)
No edit summary
Eschmidt (talk | contribs)
No edit summary
Line 82: Line 82:
                     field: 'dataSources',
                     field: 'dataSources',
                     formatter: function (cell) {
                     formatter: function (cell) {
                         const sources = cell.getValue();
                         const output = cell.getValue().reduce((prev, curr) => {
                        let out = sources.reduce((prev, curr) => {
                             const src = dataSources.find(src => src.name === curr);
                             return prev + '<img src="' + dataSources.find(src => src.name === curr).image + '">'
                            const url = src ? src.image : '';
                            return url ? prev + '<img class="data-source-img" src="' + url + '">' : prev + ' ' + curr;
                         }, '');
                         }, '');
                         return out;
                         return output;
                     }
                     }
                 }
                 }

Revision as of 14:12, 7 June 2022

Development verstion of the DCT List.
Not ready for production!