« Return to the blog entry
Hi Rishi,
Woops. I should have mentioned that the code from yesterday, which builds the view in the first place needs to change in order to use this new feature.
My code differs from yours and looks like this:
col.visible = (!column.hasOwnProperty("@viewByDefault") || column.@viewByDefault=="true");
It's important to first check the column "hasOwnProperty". If it doesn't have it then the code you've written is likely to throw an error.
Jake
Hi Rishi,
Woops. I should have mentioned that the code from yesterday, which builds the view in the first place needs to change in order to use this new feature.
My code differs from yours and looks like this:
col.visible = (!column.hasOwnProperty("@viewByDefault") || column.@viewByDefault=="true");
It's important to first check the column "hasOwnProperty". If it doesn't have it then the code you've written is likely to throw an error.
Jake