- Home
- Forum
- ASP.NET MVC
- Issue with responsive grid when container expands
Issue with responsive grid when container expands
Html.EJ().Grid<MyModel>("grid") .Datasource(ds => ds.URL(Url.Action("BatchDataSource", "Model")).BatchURL(Url.Action("BatchUpdate", "Premium")).Adaptor(AdaptorType.UrlAdaptor)) .EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Batch); }) .ToolbarSettings(toolbar => { toolbar.ShowToolbar().CustomToolbarItems(GetGridCustomToolbarItems()); }) .AllowResizing().AllowResizeToFit().AllowTextWrap().AllowPaging().AllowSearching().AllowSelection().SelectionType(SelectionType.Multiple) .IsResponsive(true).EnableResponsiveRow(false) .ScrollSettings(scroll => { scroll.Height(400); }) .MinWidth(600) .Columns(col => { ... }) .ClientSideEvents(e => { ... })
Attachment: grid_with_menu_collapsed_8063f97d.zip
We have analyzed your requirement and achieved using set dimension method in window.onresize event .we need to give this code after scriptManager(_layout.cshtml file) to work like successor of default window resize event in Grid. Please refer to the below code example and sample.
Code example:
|
@Html.EJ().ScriptManager() @RenderSection("scripts", required: false) <script type="text/javascript"> $(function () { $('#page').css("min-height", $(document).height()); window.onresize = function () { for (i = 1; i < $(".e-grid").length;i++){ var childid = $(".e-grid").eq(i).attr('id'); var gridobj = $("#" +childid).ejGrid("instance") gridobj.setDimension(gridobj.element.parent().innerHeight(), gridobj.element.parent().innerWidth()); gridobj.getContent().ejScroller("refresh"); } } }); |
Sample: http://www.syncfusion.com/downloads/support/forum/121722/ze/SyncfusionMvcApplication38682239631
We have faced another issue while window resize with expandable grid, expandable scroller auto scroll when click the scroller for child grid. We need to analysis this behavior and update you on 21st jan 2016.
Regards,
Jayaprakash K.
Hi Debbie,
Thanks for the update.
We already have help documentation for setDimension method. Please refer to the below link.
Link: http://help.syncfusion.com/js/api/ejgrid#methods:dimension
We are able to reproduce the issue while window resize with expandable grid, expandable scroller auto scroll when clicking the scroller for child grid. So, a support incident has been created under your account to resolve the issue. Please log on to our support website to check for further updates.
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents
Regards,
Jayaprakash K.
http://help.syncfusion.com/aspnetmvc/grid/responsive - shows mobile rendering for below 321 px, but not parent container re-sizing information.
- Do I need to set both rows & grid as responsive, how is this handled inside ASP MVC rzr.
- Next I see the scriptmanager before rendersection, does this mean the scriptmanager has to be in head?
thanks
Thanks for the update.
Please find the response in below table.
|
Query |
Response |
|
1. I could not find the dimension method in the MVC documentation to setup inside razr view |
setDimension is an javascript method. So we have provided under the javascript API reference. |
|
2. Shows mobile rendering for below 321 px, but not parent container re-sizing information. |
We have created the improvement task for responsive re-sizing online help documentation. |
|
3. Do I need to set both rows & grid as responsive, how is this handled inside ASP MVC razor |
IsResponsive property for both height and width of the grid control. So no need to set separately to grid rows. |
|
4. Next I see the scriptmanager before rendersection, does this mean the scriptmanager has to be in head? |
No, scriptmanager method is recommended in registering Syncfusion.Mvc components script files. The ScriptManager() method should be placed after all the components on the page. You need to add it before the closing body tag in the _Layout.cshtml file. Please refer to the online help documentation, Document: Link |
Regards,
Sellappandi R
- 7 Replies
- 4 Participants
-
DF Debbie Facey
- Jan 19, 2016 03:54 PM UTC
- Jan 25, 2016 11:17 AM UTC