This is a migrated thread and some comments may be shown as answers.

[Solved] Multiple editors on the page with Snippets insert to the LAST editor on the page ONLY

0 Answers 9 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Max
Top achievements
Rank 1
Max asked on 27 Jul 2012, 09:15 PM
I am Using: MVC 3, Razor and the latest telerik extentions for mvc

I have multiple editors on the page with snippets. When I choose an item from the dropdown to insert into the first editor on the page it inserts it to the last editor on the page. not good... help!

@using (Html.BeginForm())
{
  @Html.ValidationSummary(true)
  <fieldset>
    <legend>New Feature</legend>
    <div class="display-label" onclick="FeatureCreate();" style="width: 607px; background: #D7EBFF;
      cursor: pointer;">
      Module #@ViewBag.ModuleID Description <span class="DescriptionLabel">+</span></div>
    <div class="display-field Description" style="display: none; width: 600px;">
      @Html.Raw(ViewBag.ModuleDescription)
    </div>
    <div class="editor-label">
      @Html.LabelFor(model => model.ActionTriggerEvent, "Action")
    </div>
    <div class="editor-field">
      @(Html.Telerik().EditorFor(m => m.ActionTriggerEvent)
      .HtmlAttributes(new { @style = "height:100px; width:600px;", @id="ActionEditor" })
            .Tools(tools => tools
            .ViewHTML()
            .Separator()
   .Custom(s => s.Template(t => Html.ActionLink("Manage Materials", "SupplementalMaterials", "Project", new { id = (int)ViewBag.ProjectID }, null)))
            .Separator()
            .Snippets(snippets =>
            {
              foreach (cda_SapplementalMaterials item in (IEnumerable<cda_SapplementalMaterials>)ViewBag.supplemental)
              {
                if (item.ItemType == 2)
                  snippets.Add(item.ResourceName, "<a href='/SupplementalMaterials/GetSupplFile/" + item.SupplementalMaterialID + "' target='_blank'>" + item.ResourceName + "</a>");
                else
                  snippets.Add(item.ResourceName, "<a href='" + item.ItemPath + "' target='_blank'>" + item.ResourceName + "</a>");
              }
            })))
      @Html.ValidationMessageFor(model => model.ActionTriggerEvent)
    </div>
    <div class="editor-label">
      @Html.LabelFor(model => model.VisibleReaction, "Visible Reaction")
    </div>
    <div class="editor-field">
      @(Html.Telerik().EditorFor(m => m.VisibleReaction)
      .HtmlAttributes(new { @style = "height:100px; width:600px;", @id = "VReactionEditor" }))
      @Html.ValidationMessageFor(model => model.VisibleReaction)
    </div>
    <div class="editor-label">
      @Html.LabelFor(model => model.InternalReaction, "Internal Reaction")
    </div>
    <div class="editor-field">
      @(Html.Telerik().EditorFor(m => m.InternalReaction)
      .HtmlAttributes(new { @style = "height:100px; width:600px;", @id = "IReactionEditor" })
            .Tools(tools => tools
            .ViewHTML()
            .Separator()
   .Custom(s => s.Template(t => Html.ActionLink("Manage Materials", "SupplementalMaterials", "Project", new { id = (int)ViewBag.ProjectID }, null)))
            .Separator()
            .Snippets(snippets =>
            {
              foreach (cda_SapplementalMaterials item in (IEnumerable<cda_SapplementalMaterials>)ViewBag.supplemental)
              {
                if (item.ItemType == 2)
                  snippets.Add(item.ResourceName, "<a href='/SupplementalMaterials/GetSupplFile/" + item.SupplementalMaterialID + "'>" + item.ResourceName + "</a>");
                else
                  snippets.Add(item.ResourceName, "<a href='" + item.ItemPath + "' target='_blank'>" + item.ResourceName + "</a>");
              }
            })))
    </div>
    <div class="editor-label">
      @Html.LabelFor(model => model.Notes)
    </div>
    <div class="editor-field">
      @Html.TextAreaFor(model => model.Notes, new { @class = "expand", @style = "width:600px" })
      @Html.ValidationMessageFor(model => model.Notes)
    </div>
    @Html.HiddenFor(model => model.ModuleID)
    <p>
      <input type="submit" value="Create" />
      |
      @Html.ActionLink("Go Back", Navigation.GetMe().GetPreviousNavPath().ActionName
    , Navigation.GetMe().GetPreviousNavPath().ControllerName.ToString()
    , new { id = Navigation.GetMe().GetPreviousNavPath().ID }
    , null)
      | <a href="https://skydrive.live.com/redir?resid=sdfasdafasdf!228&authkey=!Adsafasdfdsa"
        target="_blank">Help</a>
    </p>
  </fieldset>
}
Tags
Editor
Asked by
Max
Top achievements
Rank 1
Share this question
or