Support filtered list functionality using ugly javascript