Apr 26, 2010, 6:39 AM
[CLOSED] How to extend Ext.NET components
Hello!
I have extended class, for example this:
The main thing that interests me - the
ideology of extending components in Ext.NET.
Thanks!
I have extended class, for example this:
[assembly: WebResource("Core.View.Ext.Scripts.pagingRecalc.js", "text/javascript")]
namespace Core.View.Ext
{
using System;
using System.Collections.Generic;
using System.Web.UI;
using global::Ext.Net;
public class UniversalGrid : GridPanel
{
public UniversalGrid(string sysName, ComponentDirectEvent.DirectEventHandler eventHandler)
{
EntityTipeInfo = Domain.Current.Model.Types[sysName];
EntityName = sysName;
Frame = false;
Layout = "fit";
LoadMask.ShowMask = false;
// .... etc
if (!store.AutoLoad)
{
Listeners.AfterLayout.Fn = "pagingRecalc";
Listeners.AfterLayout.Single = true;
}
}
protected override List<ResourceItem> Resources
{
get
{
List<ResourceItem> baseList = base.Resources;
baseList.Capacity += 1;
baseList.Add(new ClientScriptItem(typeof(UniversalGrid),
"Core.View.Ext.Scripts.pagingRecalc.js",
@"Core.View.Ext\Scripts\pagingRecalc.js"
));
return baseList;
}
}
}
}
I would need often extend base classes, and I want do it nice. Here I added only one JS file and some pre-init logic. But sometimes I would need add imagis, CSS, and other resources or client and server logic. I interesting how to do it right. Maybe you have some samples, tutorials or clear examples of extending server classes with including client code/resources? The main thing that interests me - the
ideology of extending components in Ext.NET.
Thanks!