We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to enable horizontal scrolling (Column Scrolling) in Grid, when the column width exceeds the target?

To enable horizontal scrolling for column, an inbuilt option is present with the scroll settings.
When you set enableColumnScrolling as true, then horizontal scrolling gets enabled. This occurs when the grid element width exceeds the parent element’s width (By default, grid element renders the relative to its parent element). For example, when the parent element of grid container’s width is 400 and the grid container’s width is 700 then, you can scroll the grid container when column scrolling is enabled. Therefore, you can scroll the grid horizontally by swiping left or right onto the grid header. 

Note: The grid element width exceeds its container width only when the width of all individual column is set by using grid’s columns property.
Refer to the following code example.

Script

$(function () {

// the datasource "window.gridData" is referred from jsondata.min.js

var data = ej.DataManager(window.gridData).executeLocal(ej.Query().take(50));

$("#mobgridscrolling").ejmGrid({

dataSource: data,

allowPagingfalse,

allowScrollingtrue,

scrollSettings: { enableColumnScrollingtrue, enableRowScrollingtrue, height: 220 },

columns: [

{ field: "OrderID", headerText"Order ID", width: 100 },

{ field: "CustomerID", headerText"Customer ID", width: 140 },

{ field: "Freight", headerText"Freight", width: 100 },

{ field: "EmployeeID", headerText"EmployeeID", width: 150 },

{ field: "ShipCity", headerText"ShipCity", width: 150 }

],

});

});

 

Article ID: Published Date: Last Revised Date: Platform: Control:
4950 05/23/2015 05/23/2015 JavaScript ejmGrid
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.