I've found a few posts about this but none of them I saw were actually answered.
Here's my problem - I have a listgrid, by default grouped by Continent. When the listgrid is rendered, the grouping shows up correctly but the column is also showing so I end up with redundant data. Is this desired behaviour? I tried working around it by setting showIf on the column (code provided below) and it works initially..but if I ungroup by continent, the column does not reappear. I also know that showIf is only called during initial rendering and if refreshFields is called so I dont even think this is the right place to do it if anything. How do you recommend making this behaviour work?
Here's my problem - I have a listgrid, by default grouped by Continent. When the listgrid is rendered, the grouping shows up correctly but the column is also showing so I end up with redundant data. Is this desired behaviour? I tried working around it by setting showIf on the column (code provided below) and it works initially..but if I ungroup by continent, the column does not reappear. I also know that showIf is only called during initial rendering and if refreshFields is called so I dont even think this is the right place to do it if anything. How do you recommend making this behaviour work?
Code:
isc.ListGrid.create({ ID: "countryList", width:522, height:224, alternateRecordStyles:true, cellHeight:22, dataSource: countryDS, fields:[ {name:"countryName"}, {name:"government"}, {name:"continent"} }, {name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false} ], groupStartOpen:"all", groupByField: 'continent', autoFetchData: true })
Code:
showIf: function(list, field, fieldNum){ if(list.canGroupBy){ var groupList = list.getGroupByFields(); for(var i = 0; i< groupList.length;i++){ if(groupList[i] == field.name){ return false; } } } return true;//return this.Super("showIf",[list,field,fieldNum]);
Comment