List Customisation

From Sage CRM Knowledge Base
Revision as of 10:52, 25 June 2015 by Crmtogetherkb (talk | contribs) (Created page with " Client-side function to clear out empty rows on a table (tested in 7.1 only) -Makes an assumption about the first Td being empty function clearEmpptyTableRows() { var trco...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Client-side function to clear out empty rows on a table (tested in 7.1 only)

-Makes an assumption about the first Td being empty

function clearEmpptyTableRows() {

var trcol=document.getElementsByTagName("TR");
 
 for (var i=1;i<trcol.length;i++)
 {
   //get the first td

var _td=trcol[i].childNodes[0]; if (_td!=null) {

if ((_td.innerHTML=="")||(_td.innerHTML==null)||(_td.innerHTML==" ")) { if ((_td.className=='ROW2')||(_td.className=='ROW1')) { trcol[i].style.visibility='hidden'; trcol[i].style.display='none'; } }else{ //console.log(i+"-"+_td.innerText); //console.log(i+"-"+_td.innerHTML); } }

 }

}