I want to dynamically show/hide fields when data has arrived. I have the following code, but when I click on the button that is supposed to hide Country Name, it doesn't do anything.
Code:
isc.ListGrid.create({ ID: "countryList", width:500, height:224, alternateRecordStyles:true, data: countryData, fields:[ {name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"}, {name:"countryName", title:"Country"}, {name:"capital", title:"Capital", showIf:"false"}, {name:"continent", title:"Continent"} ], canReorderFields: true }) isc.IButton.create({ left:0, top:240,autoFit: true, title:"Hide Country Name", click:function(){ var arr = new Array(); arr[0] = this.getField('countryName'); countryList.hideFields(arr); countryList.refreshFields(); } })
Comment