window.renderCell = function(result, {col, row}) { if(col.name === 'name') { if(typeof result[0].props == 'object') result[0].props.className = 'clip w-max'; if(row.data.postponed) result[result.length] = {html:'' + row.data.delayInfo + ''}; if(row.data.type == 'program' && !isAdmin && !privPrograms.includes(row.data.id.toString())) result[0].type = 'span'; return result; } if(col.name === 'budget') { let budgetHtml = `
${row.data.budget}
`; if(typeof(row.data.exceedBudget) != 'undefined') { let iconSign = ' '; let menu = ''; let dropMenu = menu; dropMenu += '
' + projectBudgetLang + ': ' + row.data.rawBudget + '
'; dropMenu += '
' + remainingBudgetLang + ': ' + row.data.remainingBudget + '
'; dropMenu += '
' + exceededBudgetLang + ': ' + row.data.exceedBudget + '
'; if(row.data.type == 'program') { if(row.data.parent == 0) iconSign = ' '; dropMenu = menu; dropMenu += '
' + programBudgetLang + ': ' + row.data.rawBudget + '
'; dropMenu += '
' + sumSubBudgetLang + ': ' + row.data.subBudget + '
'; dropMenu += '
' + exceededBudgetLang + ': ' + row.data.exceedBudget + '
'; } iconSign = '' + iconSign + ''; budgetHtml = `
${row.data.budget}${iconSign}${dropMenu}
` } result[0] = {html: budgetHtml, className:'flex w-full items-end mr-1', style:{flexDirection:"column"}}; return result; } if(col.name === 'invested') { result[0] = {html: '
' + row.data.invested + ' ' + langManDay + '
', className:'flex w-full items-end', style:{flexDirection:"column"}}; return result; } if(col.name == 'charter') { const charterName = charterList[row.data.charter] !== undefined ? charterList[row.data.charter] : ''; const charterHtml = hasCharterViewPriv ? '' + charterName + '' : charterName; result[0] = {html: '
' + charterHtml + '
', className:'flex w-full', style:{flexDirection:"column"}}; } return result; }