Advanced Examples
Project management spreadsheet
A simple example including table scripting to perform a photo update and a progress bar added to any new task
Source code
<html> <script src="https://jexcel.net/v7/jexcel.js"></script> <script src="https://jexcel.net/v7/jsuites.js"></script> <link rel="stylesheet" href="https://jexcel.net/v7/jexcel.css" type="text/css" /> <link rel="stylesheet" href="https://jexcel.net/v7/jsuites.css" type="text/css" /> <div id="spreadsheet"></div> <script> var data1 = [ [ '=B1', '1', 'New products section', '2019-02-12', '80', '=PROGRESS(E1, "darkgreen")' ], [ '=B2', '1', 'API integration', '2019-03-01', '100', '=PROGRESS(E2, "darkgreen")' ], [ '=B3', '7359', 'Deck', '2018-11-10', '30', '=PROGRESS(E3, "darkgreen")' ], [ '=B4', '1', 'Prototype', '2019-01-12', '0', '=PROGRESS(E4, "darkgreen")' ], ]; var mySpreadsheet = jexcel(document.getElementById('spreadsheet'), { data:data1, columns: [ { type: 'text', width: '60px', title: 'Photo', readOnly:true }, { type: 'dropdown', width: '140px', title: 'Name', source: [ { id:'1', name: 'Jorge'}, { id:'7359', name: 'Cosme Sergio' }] }, { type: 'text', width: '200px', title: 'Task' }, { type: 'calendar', width: '100px', title: 'When' }, { type: 'text', width: '50px', title: '%' }, { type: 'text', width: '100px', title: 'Progress' }, ], allowComments:true, updateTable: function(instance, cell, col, row, val, label, cellName) { if (col == 0) { if (instance.jexcel.options.data[row][col+1]) { cell.innerHTML = '<img src="/templates/default/img/' + instance.jexcel.options.data[row][col+1] + '.jpg" style="width:24px;border-radius:16px">'; } else { cell.innerHTML = '<img src="/templates/default/img/nophoto.jpg" style="width:24px;border-radius:16px">'; } } }, license: 'YjQzMzdlOTRiOGY3ZTQ0ZDQ4ZTI1YWU3MDFjMDI0ZWJmOTNjODA1NWFiZTRiNDJhNmRiYTJlZjkwODQ3N2IwMWRmNWRjYWUwZDViM2VhMmI3NzVjOTcwMzVlN2ZhODI1Y2EyMmE3NDI0ZmE0ZjVmNGQ2MWEzN2M3MTA4MThhMDUsZXlKdVlXMWxJam9pY0dGMWJDNW9iMlJsYkNJc0ltUmhkR1VpT2pFMk16SXdPVEkwTURBc0ltUnZiV0ZwYmlJNld5SnFjMlpwWkdSc1pTNXVaWFFpTENKcVpYaGpaV3d1Ym1WMElpd2lZMjlrWlhOaGJtUmliM2d1YVc4aUxDSnFjMmhsYkd3dWJtVjBJaXdpTVROemQyMHVZM05pTG1Gd2NDSXNJbXh2WTJGc2FHOXpkQ0pkTENKd2JHRnVJam9pTXlKOQ==', }); </script> </html>