I have this in my Custom Template -> List Page -> CustomTemplateBody :
<tr name="custom_add_tr" ... >
...
<div name="pasien">...</div>
<div name="spacer"></div>
<div name="kk">...</div>
...
</tr
And Startup Script:
$("tr[name='custom_add_tr']").each(function(){
var tr = parseInt($(this).height());
var pasien = parseInt($(this).find("div[name='pasien']").height());
var kk = parseInt($(this).find("div[name='kk']").height());
var spacer = tr - (pasien + kk);
$(this).find("div[name='spacer']").height(spacer);
});
Explanation:
- Custom template will draw 3 div's inside <tr> element.
- After the div's are drawn, startup script kick-in, measure the heights, give "unused height" to [spacer], so [pasien] always drawn at top-of-<tr> and [kk] drawn at bottom-of-<tr>.
Problem:
- [spacer] only get the right value if I do hard-refresh.
- In normal-refresh [spacer] height value is always 0.
What is the possible problem?
Thanks.