Conditional styling in custom template

This public forum is for user-to-user discussions of ASPMaker. Note that this is not support forum.

Conditional styling in custom template

Postby Lhaz » Mon Oct 09, 2017 9:05 pm

Hi all,

I use some conditional styling on my list page (color of a project name depending on the project status) but now that I've made a custom template of this page it won't work anymore.

In Row_Rendered :

If Page.PageID = "list" Then
If status.CurrentValue = "1" Then
project_name.CellCssStyle = "font-weight: bold; color: #DBA901"
End If
End If

In CustomTemplateBody :

<tr{{{row_attrs}}}>
<td>{{{ID}}}</td><td {{{cell_attrs}}}>{{{project_name}}}</td>
</tr>

Am I missing something ?
Lhaz
 
Posts: 54
Joined: Mon Nov 19, 2012 6:14 pm

Re: Conditional styling in custom template

Postby Webmaster » Tue Oct 10, 2017 9:42 am

Use the browser inspect feature to check and debug the elements. Note:

1. The original table is hidden and can be found in:
<table id="tbl_<Table>list" class="table ewTable hidden">
...
</table>

2. The custom template content can be found in:
<div id="tpd_<Table>list" class="ewCustomTemplate">
<div id="ct_<Table>_list">
...
</div>
</div>
Webmaster
 
Posts: 10734
Joined: Fri Aug 06, 2004 5:59 pm

Re: Conditional styling in custom template

Postby Lhaz » Thu Oct 19, 2017 7:36 pm

Thank you, I've found the solution :)

But now that I have migrated to 2018 I've noticed that .CellCssStyle in Row_rendered event won't work anymore in a custom template list page.
Lhaz
 
Posts: 54
Joined: Mon Nov 19, 2012 6:14 pm

Re: Conditional styling in custom template

Postby Webmaster » Fri Oct 20, 2017 9:48 am

Thank you for reporting. We will fix in the next build.
Webmaster
 
Posts: 10734
Joined: Fri Aug 06, 2004 5:59 pm


Return to General Discussion (ASPMaker)