[CLOSED] [1.0] Custom Control - How to embed resources?

  1. #1

    [CLOSED] [1.0] Custom Control - How to embed resources?

    Hi,

    I am currently upgrading the FileUploadDialog custom control that is available on these forums to use the 1.0 build of Ext.Net.

    Can you provide any details on key changes that need implementing? So far I have modified these:

    
    protected override string ContainerStyle
            {
                get
                {
                    return "display:none;";
                }
            }
    
            public override string InstanceOf
            {
                get
                {
                    return "Ext.ux.UploadDialog.Dialog";
                }
            }
    
            public override string XType
            {
                get
                {
                    return "window";
                }
            }
    I have also updated all core references from Coolite.Ext.Web to Ext.Net.

    The main thing I am unsure is how to include embedded resources. I looked at the GMapPanel source code but I am not sure how I would include different types of resources and both debug and release versions - the GMapPanel only has one .js file:

    My current resources which need updating are:

    
    [ClientStyle(
            Type = typeof(FileUploadDialog),
            WebResource = "Resources.CSS.Ext.ux.UploadDialog.css"
        )]
        [ClientScript(
            Type = typeof(FileUploadDialog),
            WebResource = "Resources.Scripts.Ext.ux.UploadDialog.packed.js",
            WebResourceDebug = "Resources.Scripts.Ext.ux.UploadDialog.js"
        )]
  2. #2

    RE: [CLOSED] [1.0] Custom Control - How to embed resources?

    I see how it was done to incorporate the LockingGridView:

    
    protected override List<ResourceItem> Resources
            {
                get 
                {
                    List<ResourceItem> baseList = base.Resources;
                    baseList.Capacity += 2;
                    baseList.Add(new ClientStyleItem(typeof(LockingGridView), "Ext.Net.Build.Ext.Net.ux.extensions.lockinggrid.css.LockingGridView.css", "/ux/extensions/lockinggrid/css/LockingGridView.css"));
                    baseList.Add(new ClientScriptItem(typeof(LockingGridView), "Ext.Net.Build.Ext.Net.ux.extensions.lockinggrid.LockingGridView.js", "/ux/extensions/lockinggrid/LockingGridView.js"));
    
                    return baseList;
                }
            }
    My question still remains as to how debug scripts are handled?

    Edit: I've found the overloaded constructor. Can you let me know what the path parameter should related to?
  3. #3

    RE: [CLOSED] [1.0] Custom Control - How to embed resources?

    Hi,

    Sorry, for the late response.


    Path is path to the js file. It uses if set RenderScripts=File for the ReasourceManager. So, that path should references to the js file in your application folder.


    If you don't use File mode then you can set empty string to the path


    P.S. Please don't forget to amtk resource fiels as Embedded Resource and add assembly web resource to the AssemblyInfo.cs
    [assembly: WebResource("Ext.Net.Build.Ext.Net.ux.plugins.tabfx.tabfx.js", "text/javascript")]

Similar Threads

  1. Custom Control
    By macinator in forum 1.x Help
    Replies: 0
    Last Post: Jun 21, 2012, 12:06 PM
  2. Replies: 2
    Last Post: Jan 09, 2012, 7:18 AM
  3. [CLOSED] embed display logic in ext container
    By T3rryChan in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 24, 2011, 3:40 PM
  4. [CLOSED] [1.0] Extended Control Resources property called 3 times?
    By bsnezw in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 24, 2011, 7:16 PM
  5. [CLOSED] [1.0] Custom Control Question
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 12, 2010, 12:53 PM

Tags for this Thread

Posting Permissions