Custom script for list view gives "cannot set properties of undefined"

Hi @chrislennon,

Code structure is changed. Please check the reference: