[CLOSED] Mix Standard MVC HTML Components With Ext.net

  1. #1

    [CLOSED] Mix Standard MVC HTML Components With Ext.net

    Hi
    please guide me how do I put standard MVC Html Component In Ext.Net,I try bellow but not working,

     X.Panel()
      .Content
        (
     Html.TextAreaFor(model => model.ArticalDetails, new { @class = "smallinput", @id = "wysiwyg", @name = "wysiwyg", @style = "height: 800px; width: 100%;" })@*,@id="wysiwyg"*@
       )
    I am trying to place a mce editor inside panel.
    Last edited by Daniil; May 16, 2015 at 8:38 AM. Reason: [CLOSED]
  2. #2
    Hi @matrixwebtech.

    Please use:
    @(X.Panel()
        .Content(
            @<text>
                @Html.TextAreaFor(...)
            </text>)
    )
  3. #3
    Thanks for reply ,I do Bellow code one with normal text area and another with Html.Textarea but 2nd one not editable ,can you please investigate?

    <!DOCTYPE html>
    @*@model e.Controllers.tinymcecontent*@
    @{
        var X=Html.X();
    }
    <html>
    <head><!-- CDN hosted by Cachefly -->
    <script src="//tinymce.cachefly.net/4.1/tinymce.min.js"></script>
    <script>tinymce.init({ selector: 'textarea' });</script>
    </head>
    <body>
        @X.ResourceManager()
            <textarea>Easy! You should check out MoxieManager!</textarea>
        @(X.Panel().Border(false)
        .Content(
            @<text>
                @Html.TextArea("tc")
            </text>)
    )
    </body>
    </html>
    I just want to know
    when ever I need a non EXT.net component(other standard MVC components) in ext.net should I follow this technique?
  4. #4
    The issue is probably caused because you are calling tinymce.init before the Panel is rendered. The fix should be just calling tinymce.init after the Panel is Rendered, for example from within the Panel's AfterRender Listener.

    Hope this helps.
    Last edited by geoffrey.mcgill; May 05, 2015 at 1:45 PM.
    Geoffrey McGill
    Founder & CEO
  5. #5
    Hi
    I try bellow

    <!DOCTYPE html>
    @model e.Controllers.tinymcecontent
    @{
        var X=Html.X();
    }
    <html>
    <head><!-- CDN hosted by Cachefly -->
    <script src="//tinymce.cachefly.net/4.1/tinymce.min.js"></script>
    <script></script>
    </head>
    <body>
        @X.ResourceManager()
            
        @(X.Panel().Border(false)
        .Listeners(l=>{
            l.AfterRender.Handler = "tinymce.init({ selector: 'textarea' });";
        })
        .Content(
            @<text>
                @Html.TextAreaFor(obj=>obj.content)
            </text>)
        .Buttons(X.Button().Text("Click")
                  .DirectClickAction("test")
                  )  
    )
    </body>
    </html>
    public class tinymceController : Controller
        {
            //
            // GET: /tinymce/
    
            public ActionResult Index()
            {
                return View();
            }
            public void test(tinymcecontent _tinymcecontent)
            {
                
            }
    
        }
    
        public class tinymcecontent
        {
            public string content { get; set; }
        }
    but editor's value not posted to controller , content property of tinymcecontent class is null in test method .
  6. #6
    Is anything being submitted with a DirectEvent? I would expect there is nothing.
  7. #7
    Likely because there is no <form>.
    Geoffrey McGill
    Founder & CEO
  8. #8
    Try changing X.Panel() to X.FormPanel(), or wrapping the Panel in a <form>.
    Geoffrey McGill
    Founder & CEO

Similar Threads

  1. Replies: 12
    Last Post: Sep 09, 2013, 8:27 AM
  2. [CLOSED] Force Standard Submit
    By softmachine2011 in forum 2.x Premium Help
    Replies: 3
    Last Post: May 28, 2013, 12:01 PM
  3. [CLOSED] Which accessibility standard supported by Ext.Net
    By leon_tang in forum 1.x Premium Help
    Replies: 1
    Last Post: Jul 11, 2012, 6:11 PM
  4. [CLOSED] Emulating a standard DropDownList
    By randy85253 in forum 1.x Premium Help
    Replies: 8
    Last Post: Dec 05, 2009, 8:53 PM
  5. [CLOSED] CheckboxSelectionModel Checkall as Standard
    By macap in forum 1.x Premium Help
    Replies: 11
    Last Post: Aug 05, 2009, 10:17 AM

Posting Permissions