SmartClient: v10.0p_2015-06-23
After creating a summary field in the grid, the field does not appear in the Filter Editor. I realize that summary and formula fields are display type fields and do not belong to the underlying data source, but how can I get these fields to display in the filter editor? I have another issue where I dynamically create fields in the grid after the data source is loaded, and I believe that this is the same root cause.
Reproduction steps:
1. Load test case
2. Add summary field to grid
3. Open filter editor with command: filterDialog.show()
4. Observe that the summary field is not displayed in teh field list
After creating a summary field in the grid, the field does not appear in the Filter Editor. I realize that summary and formula fields are display type fields and do not belong to the underlying data source, but how can I get these fields to display in the filter editor? I have another issue where I dynamically create fields in the grid after the data source is loaded, and I believe that this is the same root cause.
Reproduction steps:
1. Load test case
2. Add summary field to grid
3. Open filter editor with command: filterDialog.show()
4. Observe that the summary field is not displayed in teh field list
Code:
<!DOCTYPE html>
<html>
<head>
<title ></title>
<style>
.diagInfo {
font-size: 14px;
font-weight: bold;
padding: 5px;
}
</style>
<script type="text/javascript" >
var isomorphicDir="http://localhost:8080/isomorphic/";
</script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Core.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Foundation.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Containers.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Grids.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Forms.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_DataBinding.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Drawing.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_PluginBridges.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Charts.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Tools.js"></script>
<script type="text/javascript" SRC="http://localhost:8080/isomorphic/skins/SafetyNetSkin/load_skin.js"></script>
</head>
<body>
<script type="text/javascript">
var data = [
{ project: "123 Avenue", path:"East->GA->Atlanta->Engineering", redflag: "", owner: "University of MD", ins: 33, obs: 231, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "Long Project Name", path:"East->PA->Pittsburgh->Engineering",redflag: "", owner: "University of MD", ins: 33, obs: 231, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "6789 Avenue B", path:"East->PA->Pittsburgh->Finance",redflag: "", owner: "University of MD", ins: 33, obs: 23, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "123 Avenue", path:"East->PA->Pittsburgh->Maintenance",redflag: "", owner: "University of MD", ins: 33, obs: 231, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "Feliz Navidad", path:"East->VA->Newport News",redflag: "", owner: "University of MD", ins: 33, obs: 1, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "123 Avenue", path:"East->VA->Newport News->Engineering",redflag: "", owner: "University of MD", ins: 33, obs: 231, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "Whitehouse Lawn Maintenance", path:"East->PA->Philadelphia->Electrical",redflag: "", owner: "University of MD", ins: 33, obs: 231, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "123 Avenue", path:"East->PA->Philadelphia->Electrical", redflag: "", owner: "University of MD", ins: 33, obs: 1, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "Automated Teller MAchine Upgrades", path:"East->PA->Philadelphia->Electrical->Panels",redflag: "", owner: "University of MD", ins: 33, obs: 231, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "123 Avenue", path:"East->PA->Philadelphia->Plumbing",redflag: "", owner: "University of MD", ins: 33, obs: 34, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "123 Avenue", path:"West->CA->San Diego->Engineering",redflag: "", owner: "University of MD", ins: 33, obs: 1, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "123 Avenue", path:"West->CA->San Diego->Marketing",redflag: "", owner: "University of MD", ins: 33, obs: 231, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" },
{ project: "Saks Avenue", path:"West->CA->San Diego->Marketing",redflag: "", owner: "University of MD", ins: 33, obs: 1, unsafe: 9, safe: 222, insDate: "10/12/2011", score:"<img src='star-4.png'/>55%", link:"<a href=''>View Analysis</a>" }
];
// ===== DO NOT REMOVE =====
var diagLabel = isc.Label.create({
ID: "diagInfo",
width: "100%",
styleName: "diagInfo",
autoFit: true
});
// ===== DO NOT REMOVE =====
</script>
</head>
<body>
<script type="text/javascript">
// set this to the correct JIRA ticket
var JIRA_TICKET = "SNQA-942";
// once page loads set some diagnostic information, DO NOT CHANGE
isc.Page.setEvent("load", function() {
document.title = JIRA_TICKET + " (SmartClient version " + isc.versionNumber + ")";
var html = [];
html.push("Jira: " + JIRA_TICKET);
html.push("SmartClient: " + isc.versionNumber);
html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
diagLabel.setContents( html.join("<br>"));
});
isc.DataSource.create({
ID: "ds",
fields: [
//{name:PATH_DS_NAME, title:"Hierarchy", type:"text", groupingModes:[PATH_GROUP_NORMAL,PATH_GROUP_FULL]},
{name:"project", title:"Project", type:"text" },
{name:"redflag", type:"text", title:"Flag"},
{name:"owner", type:"text", title:"Owner"},
{name:"ins", type:"integer", title:"#Inspections"},
{name:"obs", type:"integer", title:"#Observations"},
{name:"unsafe", type:"integer", title:"# Non-Compliant"},
{name:"safe", type:"integer", title:"# Compliant"},
{name:"insDate", type:"date", title:"Last Inspection"}
],
cacheData:data,
clientOnly: true
});
var grid = isc.ListGrid.create({
dataSource : ds,
dataFetchMode : "local",
autoFetchData: true,
width : 1200,
align : "center",
autoDraw: false,
autoFitData : "vertical",
autoFitMaxHeight : 600,
alternateRecordStyles : true,
canAddFormulaFields : true,
canAddSummaryFields : true,
canGroupBy : true,
//canReorderFields : true,
showGroupSummary : true,
//groupByMaxRecords : 1000,
canMultiGroup : true,
useAdvancedFieldPicker : true,
advancedFieldPickerThreshold : 3,
canEditTitles: true,
nullgroupTitle: "NA"
});
var filter = isc.FilterBuilder.create({
dataSource : ds,
topOperatorAppearance : "radio",
allowEmpty : true,
height : 10
});
var filterDialog = isc.Window.create({
width : 600,
height : 350,
title : "Filter Grid",
canDragReposition : true,
canDragResize : true,
padding : 10,
autoCenter : true,
autoDraw : false,
items : [
filter,
isc.LayoutSpacer.create({
height : 10
}),
isc.HLayout.create({
membersMargin : 25,
defaultLayoutAlign : "center",
align : "center",
width : "100%",
height : 10,
members : [
isc.IButton.create({
title : "Filter",
click : function() {
grid.filterData(filter.getCriteria());
}
}),
isc.IButton.create({
title : "Clear Filter",
click : function() {
filter.clearCriteria();
grid.filterData(filter.getCriteria());
}
})
]
})
]
});
var layout = isc.VLayout.create({
width:"100%",
membersMargin: 20,
members: [
// ===== DO NOT REMOVE diagLabel
diagLabel,
// ===== place anty components here
grid
]
});
</script>
</body>
</html>
Comment