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

[Solved] Problem with MVC Editor Extension?

4 Answers 113 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.
Douglas
Top achievements
Rank 1
Douglas asked on 23 Jul 2010, 01:39 AM
The new Telerik editor looks promicing but I have encounted a problem that may or may not be a bug.  The editor displays except that they content shows up twice on the page.  This page demonstrates the problem: http://www.dougcoutts.com/Speaker/Edit/4

I have double checked the installation configuration (web.config add reference, StyleSheetRegistrar, ScriptRegistrar, reference to Telerick.Web.Mvc)

Am I doing something wrong or is this a bug with the beta editor extension? 

My Controller code is:

 

       // GET: /Speaker/Edit/5
        public ActionResult Edit(int id)
        {
           var db = new DB();
            var aSpeaker = db.Speakers.SingleOrDefault(x => x.SpeakerID == id);
            return View(aSpeaker);
        }

        //
        // POST: /Speaker/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            var db = new DB();
            var aSpeaker = db.Speakers.SingleOrDefault(x => x.SpeakerID == id);
            try
            {    
                UpdateModel(aSpeaker, collection.ToValueProvider());
                aSpeaker.WebCopy=System.Web.HttpUtility.HtmlDecode(aSpeaker.WebCopy);
                db.SubmitChanges();

                string myAction = "Edit" + "/" + id;
                return RedirectToAction(myAction); 
            }
            catch
            {
                return RedirectToAction("Index");
            }
        }

 

 

 


My View Code is:
             <div class="editor-field" >
                <%= Html.Telerik().EditorFor(model => model.WebCopy)%>
            </div>

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Jul 2010, 06:53 AM
Hello Douglas,

There is a known issue in the beta when running in .NET 4. Are you by any chance using .NET 4? If yes you could fix that easily by patching the source code:

Open EditorHtmlBuilder.cs and replace this line
.Text("document.getElementById('" + textarea.Attribute("id") + "').style.display='none'");
with this:
.Html("document.getElementById('" + textarea.Attribute("id") + "').style.display='none'");

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Douglas
Top achievements
Rank 1
answered on 23 Jul 2010, 03:24 PM
Atanas,

Thanks for your reply. 
Yes I am using .net 4.0 and it sounds like this is likely the problem.

How soon do you anticipate that the  2010.Q2.713 code be on CodePlex?

Thanks
Douglas
0
Joe Vella
Top achievements
Rank 1
answered on 20 Aug 2010, 08:54 PM

Fantastic, thanks!  Now the internal textarea is stuck at 5 rows high regardless of the height of the overall control.  I changing the hard coded value in the same .cs file you mention here as well as added a height to the style in code.  neither made any difference.  A view source on the demo reveals Telerik’s textarea is the same height as the control container despite having its rows set to 5.  I can't find anything in the css files for t-raw-content.

Is the also a .Net 4.0 thing or is this being overridden in css someplace.


Thanks,

Joe Vella
DIVIUM

0
Alex Gyoshev
Telerik team
answered on 23 Aug 2010, 07:33 AM
Hi Joe Vella,

We have addressed this problem for the official release by changing the editor rendering. Stay tuned - it will be released before the end of the month.

Best wishes,
Alex Gyoshev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Editor
Asked by
Douglas
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Douglas
Top achievements
Rank 1
Joe Vella
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or