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

I can get a custom script to work in doc view. But when in list view I receive an error “cannot set properties of undefined”

I think the reason will be that in doc view you get a reference to the form in the boilerplate code, but in list view how to access the form object so you can work with it?

image

image

Hi @chrislennon,

Code structure is changed. Please check the reference:

Thank you! I find with onload that it fires if you refresh the page, but if you come to the page from normal navigation then the event is not fired. So I am currently using ‘before_render’ which fires reliably, but doesn’t pass the ‘listview’ object. So I am doing the ui things I need to do just using javascript … document.getElement type calls.

…which is not ideal.