[CLOSED] responsiveconfig reliable?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] responsiveconfig reliable?

    hello
    I wanted to use responsiveconfig but could not get MVC version working, is this reliable? what experience do you guys have with it?

    Here is an example which should change the width of grid as soon as the screen is "tall".
    Is the usage incorrect or there is bug in responsiveconfigs:

    example as GridPanel/ArrayGrid/Simple/
    @model System.Collections.IEnumerable
    
    @{
        ViewBag.Title = "Simple Array Grid - Ext.NET MVC Examples";
        Layout = "~/Views/Shared/_BaseLayout.cshtml";
    }
    
    @section headtag
    {
        <style>
            .x-grid-row-over .x-grid-cell-inner {
                font-weight : bold;
            }
        </style>
    
        <script>
            var template = '<span style="color:{0};">{1}</span>';
    
            var change = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value);
            };
    
            var pctChange = function (value) {
                return Ext.String.format(template, (value > 0) ? "green" : "red", value + "%");
            };
        </script>
    }
    
    @section example
    {
        <h1>Simple Array Grid</h1>
    
        @(Html.X().GridPanel()
                           .ResponsiveConfig(cfg =>
                               {
                            
                            var tall = new ResponsiveRule();
                            tall.Rule = "tall";
                            tall.Config.Add(Html.X().GridPanel().Width(200));
                                   
                            cfg.Add(tall);
                        })
            .Title("Array Grid")
            .Width(600)
            .Height(350)
            .Store(Html.X().Store()
                .Model(Html.X().Model()
                    .Fields(
                        new ModelField("company"),
                        new ModelField("price", ModelFieldType.Float),
                        new ModelField("change", ModelFieldType.Float),
                        new ModelField("pctChange", ModelFieldType.Float),
                        new ModelField("lastChange", ModelFieldType.Date, "M/d hh:mmtt")
                    )
                )
                .DataSource(Model)
            )
            .ColumnModel(
                Html.X().Column().Text("Company").DataIndex("company").Flex(1),
                Html.X().Column().Text("Price").DataIndex("price").Renderer(RendererFormat.UsMoney),
                Html.X().Column().Text("Change").DataIndex("change").Renderer("change"),
                Html.X().Column().Text("Change").DataIndex("pctChange").Renderer("pctChange"),
                Html.X().DateColumn().Text("Last Updated").DataIndex("lastChange")
            )
        )
    }
    Last edited by fabricio.murta; Oct 29, 2016 at 9:04 PM. Reason: no user feedback for 7+ days
  2. #2
    Hello!

    I don't remember complaints about this example not working: Miscellaneous - Responsive - Basic.

    Did you review this example while building your Responsive version?

    EDIT: I don't see you setting a wide config. Please review your sample based on the example above.
    Last edited by fabricio.murta; Sep 02, 2016 at 6:30 PM.
  3. #3
    Well tall and wide are two different configs so basically it is the same example. Run it and make your browser narrower then u see the problem. I think the problem is somehow in mvc version of this example.
  4. #4
    Hello @mirwais!

    Please be a little more specific on your problem. I got the panel resized when I make the browser window tall here.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Hello Fabricio,
    Thank you for the response. The problem is that gridpanel gets resized but the content disappear (there is no data in the grid) the model is Companies (see Companies.GetAllCompanies()) of your MVC example .../GridPanel_ArrayGrid/Simple/

    controll action:

     public ActionResult Index()
            {
                return View(Companies.GetAllCompanies());
            }
    Recap: So when the screen is 'wide' there is the content, as soon as it becomes 'tall', resize is done but the content disappears!
  6. #6
    Hello! Got it, thanks for confirming. We could reproduce this behavior and will give a good look on the code and why the contents are lost on resizing!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 1
    Last Post: Dec 19, 2015, 11:14 AM
  2. responsiveConfig is problem
    By aimboss in forum 3.x Help
    Replies: 2
    Last Post: Mar 16, 2015, 2:43 AM
  3. Replies: 2
    Last Post: Mar 06, 2015, 2:21 PM

Tags for this Thread

Posting Permissions