As you can see bold tag doesn't make text bold within [CODE ] tags. Just for the future.
Here should be an embedded path of a resource.
[assembly: WebResource(embeddedPath, "text/javascript")]
and
new ClientScriptItem(type, embeddedPath, path)
This link should help you to understand how "embeddedPath" should look for your project.
http://www.codeproject.com/KB/dotnet...resources.aspx
"path" is used if you set RenderScripts="File" and RenderStyles="File". If no, you can just set up an empty string.
See also
http://forums.ext.net/showthread.php?7364
Now I will demonstrate how it loos on my side:
GridTotals.cs
using System.Collections.Generic;
using System.ComponentModel;
using Ext.Net;
namespace Work
{
public partial class GridTotals : Plugin
{
protected override List<ResourceItem> Resources
{
get
{
List<ResourceItem> baseList = base.Resources;
baseList.Capacity += 1;
baseList.Add(new ClientScriptItem(typeof(GridTotals), "Work.Resources.js.Ext.ux.GridTotals.js", ""));
baseList.Add(new ClientStyleItem(typeof(GridTotals), "Work.Resources.css.Ext.ux.GridTotals.css", ""));
return baseList;
}
}
public override string InstanceOf
{
get
{
return "Ext.ux.GridTotals";
}
}
}
}
AssemblyInfo.css
[assembly: WebResource("Work.Resources.js.Ext.ux.GridTotals.js", "text/javascript")]
[assembly: WebResource("Work.Resources.css.Ext.ux.GridTotals.css", "text/css")]
Please note that Work is the Namespace in my project and the js and css are placed, respectively, in:
Root project folder/Resources/js/Ext.ux.GridTotals.js
Root project folder/Resources/js/Ext.ux.GridTotals.css
I've a bit modified the css:
Ext.ux.GridTotals.css
.x-grid3-simple-totals .x-grid3-row-last {
margin-bottom: 21px;
}
.x-grid3-simple-totals .x-grid-total-row {
position: absolute;
bottom: 15px !important;
left: 0;
}
.x-grid3-simple-totals .x-grid-total-row td {
border-left: 1px solid #EEEEEE;
border-right: 1px solid #D0D0D0;
padding-left: 0px;
padding-right: 0px;
}
Example Usage
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Register Assembly="Work" Namespace="Work" TagPrefix="myExt" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
{
new object[] { 1, 4 },
new object[] { 2, 5 },
new object[] { 3, 6 }
};
store.DataBind();
}
}
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.Net Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel
ID="GridPanel1"
runat="server"
Height="150"
Width="250">
<Store>
<ext:Store runat="server">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="test1" Type="Int" />
<ext:RecordField Name="test2" Type="Int" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column Header="Test1" DataIndex="test1">
<CustomConfig>
<ext:ConfigItem Name="summaryType" Value="sum" Mode="Value" />
</CustomConfig>
</ext:Column>
<ext:Column Header="Test2" DataIndex="test2">
<CustomConfig>
<ext:ConfigItem Name="summaryType" Value="sum" Mode="Value" />
</CustomConfig>
</ext:Column>
</Columns>
</ColumnModel>
<Plugins>
<myExt:GridTotals runat="server" />
</Plugins>
</ext:GridPanel>
</form>
</body>
</html>