PDA

View Full Version : how to toggle column display



xrx215
25 Nov 2009, 7:23 AM
I have a grid panel i need to show / hide columns in a gris panel depending on the value of a checkbox.If the checkbox is cheked i ned to diaplay column in the grid and if it is unchecked i need to hide the column in the grid.


Here is my code

var chkEnableDisplayResponsibilityForAction = '<%=Session["chkEnableDisplayResponsibilityForAction"]%>';
var flags = Boolean.parse(chkEnableDisplayResponsibilityForAction); var flags1 = !Boolean.parse(chkEnableDisplayResponsibilityForAction)
var colModel = new Ext.grid.ColumnModel([ { header: "PricePlanID", width: 100, sortable: true, dataIndex: 'PricePlanID', hidden: flags, hideable: flags1 }, ]);





when i refresh the page iam not able to toggle the columns depending on the value of the checkbox. But when i login and log out iam able to see the changes in the grid panel.Can anyone help me in refreshing the column values in the grid panel?