I am trying to get the onQuickLaunch flag from a SP.List using javascript. I am able to get other list attributes, however when I try to execute
list.get_onQuickLaunch();
I get an error
Uncaught Error: The property or field has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested.
Below is my code, I started traversing down to the quickLaunch object hoping it would help me, but it doesn't look like it has.
ctx = SP.ClientContext.get_current();
web = ctx.get_web();
nav = web.get_navigation();
ql = nav.get_quickLaunch();
list = web.get_lists().getByTitle('Hey');
ctx.load(web);
ctx.load(nav);
ctx.load(ql);
ctx.load(list);
ctx.executeQueryAsync(function() {
console.log('done');
console.log(list.get_onQuickLaunch());
});