Not sure what I am doing wrong here. I basically want to hide/show columns dynamically by calling hideFields/showFields but once I hide the fields, it's as if they are being removed from the list completely. What am I missing? If I do one by one it works fine (by calling hideField/showField).
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,
title:"Show Capitals",
click:"var arr = window.Array.create(); arr[0] = countryList.getField('capital');arr[1]=countryList.getField('continent');countryList.showFields(arr);"
})
isc.IButton.create({
left:120, top:240,
title:"Hide Capitals",
click:"var arr = window.Array.create(); arr[0] = countryList.getField('capital');arr[1]=countryList.getField('continent');countryList.hideFields(arr);"
})
Comment