[OPEN] [#399] Plugin BoxSelect

Page 2 of 2 FirstFirst 12
  1. #11
    Hello!

    Could you provide generated JS script?

    Also, we will include very similar component in our next release, which should be during the next week.
  2. #12
    Hi Baidaly!

    I'm having a hard time locating the generated javascript as I am using box select on a partial view that I am dynamically loading. I have noticed that if boxselect isn't dynamically loaded it works. I've created a small sample application to demonstrate here: https://skydrive.live.com/redir?resi...nt=file%2c.zip To view the working code go to home/working. Otherwise, just hit the button to see it not working. I've hardcoded createnewonenter to true in boxselect.js for easy testing.

    I'm excited to see that Ext.Net is releasing a similar component very soon! Just want to make sure I can get the generic component route working for other extjs components I might discover along the way.

    Thanks!

    Markus
  3. #13
    Sorry, but you have to post your code sample in the thread:

    http://forums.ext.net/showthread.php?3440
    http://forums.ext.net/showthread.php?10205
  4. #14
    No problem, here's the highlight reel:

    HomeController.cs
    public class HomeController : Controller
        {
            public ActionResult Index()
            {
                return View();
            }
    
            public ActionResult Working()
            {
                return View("_Panel");
            }
    
            public Ext.Net.MVC.PartialViewResult Panel(string containerId)
            {
                return new Ext.Net.MVC.PartialViewResult
                {
                    RenderMode = RenderMode.AddTo,
                    ViewName = "_Panel",
                    ContainerId = containerId,
                    WrapByScriptTag = false
                };
            }
        }
    Index.cshtml
    @(Html.X().FormPanel()
        .Layout(LayoutType.Form)
        .Items(
            Html.X().Button()
                .Listeners(l => l.Click.Handler = "Ext.net.DirectMethod.request({ url: '" + Url.Action("Panel") + "', params: {containerId: 'panelTarget'}});")
                .Text("Load View"),
            Html.X().Panel()
                .ID("panelTarget")
                .Height(200)
        )
    )
    _Layout.cshtml
    <!DOCTYPE html>
    <html>
    <head>
        <title>@ViewBag.Title</title>
        <script src="@Url.Content("~/Scripts/BoxSelect.js")" type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/BoxSelect.css")" />
    </head>
    <body>
        @(Html.X().ResourceManager()
        )
        @RenderBody()
    </body>
    </html>
    _Panel.cshtml
    @(Html.X().FormPanel()
        .Layout(LayoutType.Form)
        .Items(
            Html.X().FieldSet()
            .Items(i => i.Add(
                new GenericComponent<ComboBox> { 
                    GenericInstanceOf = "Ext.ux.form.field.BoxSelect", 
                    GenericXType = "boxselect", 
                    Component = { FieldLabel = "test", Width = 200 } }))
        )
    )
    RouteConfig.cs
        public class RouteConfig
        {
            public static void RegisterRoutes(RouteCollection routes)
            {
                routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
                routes.IgnoreRoute("{exclude}/{extnet}/ext.axd");
    
                routes.MapRoute(
                    name: "Default",
                    url: "{controller}/{action}",
                    defaults: new { controller = "Home", action = "Index" }
                );
            }
        }
    Standard web.config & viewstart.cshtml
  5. #15
    Thank you for the test case. It looks a bug. We are investigating.
  6. #16
    Currently, please set up
    RenderXType = false
    for the GenericComponent's Component.

    Though, we will try to fix it anyway.
  7. #17
    Cool, workaround works! Thanks for that, please let me know if you're able to find a more permanent solution.
  8. #18
    Here is a simplified test case.

    View
    @{
        var X = Html.X(); 
    }
    
    <!DOCTYPE html>
    <html>
    <head>
        <title>Ext.Net.MVC v2 Example</title>  
        
        <script>
            Ext.define("MyWidget", {
                extend: "Ext.Component",
                alias: "widget.mywidget",
    
                html: "I am MyWidget"
            });
        </script>
    </head>
    <body>
        @X.ResourceManager()
    
        @Html.ExtPartial("~/Views/Razor/GenericComponent.cshtml")
    
        @X.Button().Text("Render").DirectClickAction("Render")
    
        @X.FormPanel().ID("FormPanel1")
    </body>
    </html>
    Partial View
    @(Html.X().FormPanel()
        .Items(new GenericComponent<ComboBox>()
            {
                GenericInstanceOf = "MyWidget",
                GenericXType = "mywidget",
                Component = { FieldLabel = "test" }
            })
    )
    Controller
    public ActionResult Index()
    {
        return View();
    }
    
    public Ext.Net.MVC.PartialViewResult Render()
    {
        return new Ext.Net.MVC.PartialViewResult
        {
            RenderMode = Ext.Net.RenderMode.AddTo,
            ViewName = "GenericComponent",
            ContainerId = "FormPanel1"
        };
    }
    The essential part to reproduce is:
    RenderMode = Ext.Net.RenderMode.AddTo
    It is not reproducible with RenderMode.RenderTo.
  9. #19
Page 2 of 2 FirstFirst 12

Similar Threads

  1. BoxSelect or TagControl
    By PetrSnobelt in forum 2.x Help
    Replies: 0
    Last Post: Feb 14, 2013, 8:52 AM
  2. [CLOSED] Ext.ux.TabReorderer plugin?
    By jchau in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 04, 2012, 4:16 PM
  3. [CLOSED] Plugin
    By boris in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Nov 23, 2011, 1:10 PM
  4. 1.0 generic plugin
    By [WP]joju in forum 1.x Help
    Replies: 7
    Last Post: Dec 07, 2009, 12:37 PM

Tags for this Thread

Posting Permissions