Custom Dojo widget with external resources

Member since: 2012

I am building custom widget for tag selection in CMS edit mode and would like to use custom styles and scripts, but can't get them loaded on the page.

Here is what I have.

I have this file structure:


 Then I have EditorDescriptor to load my dojo Widget for tag editing:

    [EditorDescriptorRegistration(TargetType = typeof(string), UIHint = "Tags")]
    public class TagsEditorSelectionEditorDescriptor : EditorDescriptor
        public TagsEditorSelectionEditorDescriptor()
            ClientEditingClass = "tags.TagsSelection";


function (
    TextBox) {

    return declare([TextBox], {
        postCreate: function() {


And module.config:

<?xml version="1.0" encoding="utf-8"?>
    <add assembly="Sample.Web" />

    <add name="tags-vendor" path="Tags/vendor/jquery-2.0.3.js" resourceType="Script" sortIndex="1" />
    <add name="tags-vendor" path="Tags/vendor/jquery-ui-1.10.3.js" resourceType="Script" sortIndex="2" />
    <add name="tags-styles" path="Tags/styles/jquery-ui.css" resourceType="Style" sortIndex="1" />
    <add name="tags-vendor" path="Tags/vendor/tag-it.js" resourceType="Script" sortIndex="3" />
    <add name="tags-styles" path="Tags/styles/jquery.tagit.css" resourceType="Style" sortIndex="2" />

    <add name="tags" path="Tags" />
      <add name="tags-vendor" />
      <add name="tags-styles" />

On the page type which uses tags selection I defined property with UIHint:

        public virtual string Tags { get; set; }

And I am rendering it in the view:

@Html.PropertyFor(m => m.CurrentPage.Tags)

When I open edit mode and start editing the field I see in Chrome Developer Tools Network tab that TagsSelection.js is loaded, but there are no resources which are defined in modules.config.

I found this thread in forum:

It describes that defining resources in modules.config is enought (at least as I understand).

Same also on Stack Overflow and other resources:

What I am missing?

#83163 Mar 26, 2014 21:32