3
data-bind="koGrid: { data: ViewModel.statistics,
                             columnDefs: [  { displayName: 'Name', field: 'toName', sortable: true, headerTemplate: 'TmplStatsHeader', headerClass: 'left15 ' },
                                            { displayName: 'Email', field: 'email', sortable: true, headerTemplate: 'TmplStatsHeader', headerClass: 'left30 ' },
                                         ],

I have a ko grid my column definition is above

I have to show Email (second column) only based on some condition.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Kuttan Sujith
  • 7,889
  • 18
  • 64
  • 95

1 Answers1

0

You have to use Cell Template to change/show the cell value based on other property.

Thaadikkaaran
  • 5,088
  • 7
  • 37
  • 59
  • what about hiding/showing the HEADER of the column? if you use the celltemplate you will only hide the contents of the gird, not the whole column. – fascynacja Dec 23 '13 at 11:26
  • I mentioned Cell Template. Its applicable to [Header Cell](https://github.com/ericmbarnard/KoGrid/wiki/Defining-Columns) too. – Thaadikkaaran Dec 24 '13 at 05:42