[CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

    In my case, I have a page, that does not have any GridPanel on it, when the page is initially rendered. However, depending upon user interaction, I need to create new Ext.net.GridPanel on client-side.

    The problem is that the Grid resources are not on the page, as it did not had any instance of it on the page during initial page load. Here I am looking for 2 solutions:


    1) Ability to register Component resources manually, with something like:

    resourceManager1.RegisterResources<GridPanel>();
    I know this can be troublesome to achieve. I studied the code to notice that each successive derived class overrides the Resources property, and adds its own to the base class' resources. The above request would need some kind of a static method on the Component class, and there are obvious restrictions on static method overriding :(

    My current workaround is to add a Hidden GridPanel to page on load.

    2) Something sort of MSDN (http://msdn.microsoft.com/en-us/libr...exception.aspx)

    It would be very useful if I can add scripts manually like in

    <script type="text/javascript src="/Ext.Net.GridPanel/coolite.axd"></script>
    For the second point above, I am not sure whether it is at all practical (a Component might require multiple scripts/css files to be registered on page).
    Last edited by geoffrey.mcgill; Feb 22, 2011 at 5:13 AM.
  2. #2

    RE: [CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

    Hi,

    1. ResourceManager already has static method which registers resources of required class
    ResourceManager.RegisterControlResources<GridPanel>();

    2. You can register control resources via script/style tags. Just need to know resources list
    <script type="text/javascript" src="/extnet/extnet-data-js/ext.axd?v=18061"></script>

    Please note that 'v=18061' is cache buster, you can omit it or set own
  3. #3

    RE: [CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

    vladimir (4/7/2010)

    1. ResourceManager already has static method which registers resources of required class

    ResourceManager.RegisterControlResources<GridPanel>();
    Well, I searched for RegisterAllResources, RegisterResources and similar methods, but somehow skipped that particular name. It's surely a cool feature to have.

    vladimir (4/7/2010)

    2. You can register control resources via script/style tags. Just need to know resources list
    <script type="text/javascript" src="/extnet/extnet-data-js/ext.axd?v=18061"></script>
    Please note that 'v=18061' is cache buster, you can omit it or set own
    Another cool feature... Thanks for the reply vlad!!!
    Last edited by geoffrey.mcgill; Feb 22, 2011 at 5:13 AM.
  4. #4

    RE: [CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

    Well, I ran intro trouble when I actually tried to use this feature. First, I am not able to achieve clean-urls for Ext resources. I use the following in web.config:

    <extnet scriptMode="Debug" cleanResourceUrl="true" />


    but still, the urls appear as:
    /WebResource.axd?d=V0eKQdBaIZT2bgNG12vsoVMuKcQ5w1bs 4qQrV2Jp8rWQcrpWzbwqd4rg1z-oVipCndUFLtlyYSetaDXEU0sB_w2&amp;amp;t=63406149065 5380770


    Secondly, can you give a sample url for the resource:


    /resources/images/default/grid/grid3-hrow.gif

  5. #5

    RE: [CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

    Hi,

    1. Does that resource from your assembly or Ext.NET resource? We can clean Ext.NET resources url only


    2. /extjs/resources/images/default/grid/grid3-hrow-gif/ext.axd
  6. #6

    RE: [CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

    vladimir (4/20/2010)Hi,1. Does that resource from your assembly or Ext.NET resource? We can clean Ext.NET resources url only

    I understand that, and the resource is from Ext.Net only (All css, jss, icon urls are rendered with that WebResource.axd instead of clean Ext Urls even with the required attribute in web.config).
  7. #7

    RE: [CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

    Hi,

    I think that if you have WebResource.axd links then toolkit cannot find ResourceHandler in the web.config. Can you create a test project which reproduces the issue and post it?
  8. #8

    RE: [CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

    Please see the attached project.

    It might be important to mention that I am on Win 7 running my project off IIS 7.


    Also, please notice that you provide a Sample.Web.config file inside the root of the Ext.Net.Examples project. Please note that the configuration in that file only addresses IIS 6 and earlier (the Ext config exists only for system.web section).


    You need to add configuration to <system.webServer> section also for addressing IIS 7. This might help users coming on to Ext.Net/Coolite initially.


    EDIT: I later checked the main web.config in the Examples project. It also has system.webServer entries missing. A user running them off IIS 7 might be confused.
  9. #9

    RE: [CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

    Please remove .dlls and reattach sample. All attachments >1 MB are removed.

    Just let us know which version you are using and we'll add local references to the .dlls.





    Geoffrey McGill
    Founder
  10. #10

    RE: [CLOSED] [1.0] Ability to register Scripts for a Component without having any instance of it on the Page

    Hi geoff, please find the project attached again.

    I am using [1.0] code from the SVN compiled locally. The code is approx. 10-12 days old.
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Scripts at bottom of page
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 07, 2011, 7:53 PM
  2. [CLOSED] de-register or override the resource manager from master page
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 22, 2011, 2:48 PM
  3. Replies: 7
    Last Post: Nov 19, 2009, 2:55 AM
  4. Replies: 1
    Last Post: May 22, 2009, 7:38 AM
  5. Replies: 2
    Last Post: Feb 09, 2009, 12:21 PM

Posting Permissions