A Razor builder for GrouperHeaderTpl was missed. It has been fixed in SVN, please update.
I ported to Razor the entire example.
Example
@{
var X = Html.X();
}
<!DOCTYPE html>
<html>
<head>
<title>Ext.Net.MVC v2 Example</title>
<style>
.highlight-group {
background-color: red;
}
</style>
<script>
var isX = function (groupValue, records) {
var i,
isX = groupValue === "group2" ? true : false; // just for demonstration
for (i = 0; i < records.length; i++) {
// here you are getting access to each record of a current group
}
return isX;
};
</script>
</head>
<body>
@Html.X().ResourceManager()
@(X.GridPanel()
.Store(X.Store()
.GroupField("groupId")
.Model(X.Model().Fields("groupId", "test1", "test2"))
.DataSource(new object[]
{
new object[] { "group1", "1", "1" },
new object[] { "group1", "11", "11" },
new object[] { "group1", "111", "111" },
new object[] { "group2", "2", "2" },
new object[] { "group2", "22", "22" },
new object[] { "group2", "222", "222" }
})
)
.ColumnModel(
X.Column().Text("GroupId").DataIndex("groupId"),
X.Column().Text("Test1").DataIndex("test1"),
X.Column().Text("Test2").DataIndex("test2")
)
.Features(
X.Grouping().GroupHeaderTpl(X.XTemplate()
.Functions(fs => fs.Add(new JFunction() { Name = "isX", Fn = "isX"}))
.Html(@"<div <tpl if=""this.isX(groupValue, children)"" groupId === 'group2'"">class=""highlight-group""</tpl>>
Group: {name}
</div>")
)
)
)
</body>
</html>