how to show/ hide column in a extjs 3 grid panel

前端 未结 6 1149
温柔的废话
温柔的废话 2020-12-10 04:26

I have a grid panel i need to show / hide columns in a grid panel depending on the value of a checkbox. If the checkbox is checked i need to display column in the grid and i

6条回答
  •  执笔经年
    2020-12-10 05:25

    if take a look at the ExtJS API, particulary the ColumModel there is a setHidden method, it would hide/show a column in a GridPanel.

    myGrid.getColumnModel().setHidden(0, true);
    

    you should also hook the onchange event of your check box so you can show or hide the column

提交回复
热议问题