reactjs-docs/ReactJS/Kanban/Scrolling.md

5.5 KiB

layout title description documentation platform keywords
post Scrolling Scrolling ug React JS scrolling,kanban scrolling

Scrolling

Scrolling can be enabled by setting allowScrolling as true. The height and width can be set to Kanban by using the properties scrollSettings-height and scrollSettings-width respectively.

N> The height and width can be set in percentage and pixel. The default value for height and width in scrollSettings is 0 and auto respectively.

Set width and height in pixel

To specify the scrollSettings-width and scrollSettings-height in pixel, by set the pixel value as integer.

The following code example describes the above behavior.

{% highlight html %}

var data = ej.DataManager(window.kanbanData).executeLocal(ej.Query().take(20)); var scrollSetting={ width: 900, height: 450 }; ReactDOM.render( <EJ.Kanban dataSource={data} keyField="Status" fields-content="Summary" fields-primaryKey="Id" fields-tag="Tags" allowScrolling={true} scrollSettings={scrollSetting}> </EJ.Kanban>, document.getElementById('kanbanboard-default') );

{% endhighlight %}

The following output is displayed as a result of the above code example.

Set height and width in percentage

To specify the scrollSettings-width and scrollSettings-height in percentage, by set the percentage value as string.

The following code example describes the above behavior.

{% highlight html %}

var data = ej.DataManager(window.kanbanData).executeLocal(ej.Query().take(20)); var scrollSetting={ width: "70%", height: "70%" }; ReactDOM.render( <EJ.Kanban dataSource={data} keyField="Status" fields-content="Summary" fields-primaryKey="Id" fields-tag="Tags" allowScrolling={true} scrollSettings={scrollSetting}> </EJ.Kanban>, document.getElementById('kanbanboard-default') );

{% endhighlight %}

The following output is displayed as a result of the above code example.

Set width as auto

Specify width property of scrollSettings as auto, then the scrollbar is rendered only when the Kanban width exceeds the browser window width.

The following code example describes the above behavior.

{% highlight html %}

var data = ej.DataManager(window.kanbanData).executeLocal(ej.Query().take(20)); var scrollSetting={ width: "auto", height: 300 }; ReactDOM.render( <EJ.Kanban dataSource={data} keyField="Status" fields-content="Summary" fields-primaryKey="Id" fields-tag="Tags" allowScrolling={true} scrollSettings={scrollSetting}> </EJ.Kanban>, document.getElementById('kanbanboard-default') );

{% endhighlight %}

The following output is displayed as a result of the above code example.

Enabling freeze swim lane

Set scrollSettings-allowFreezeSwimlane as true. This enables scrolling with freezing of swim lane until you scroll to the next Swim lane, which helps user to aware of current swim lane target.

The following code example describes the above behavior.

{% highlight html %}

var data = ej.DataManager(window.kanbanData).executeLocal(ej.Query().take(20)); var scrollSetting= { width: "auto", height: 500,allowFreezeSwimlane: true }; ReactDOM.render( <EJ.Kanban dataSource={data} keyField="Status" fields-content="Summary" fields-primaryKey="Id" fields-swimlaneKey="Assignee" fields-tag="Tags" allowScrolling={true} scrollSettings={scrollSetting}> </EJ.Kanban>, document.getElementById('kanbanboard-default') );

{% endhighlight %}

The following output is displayed as a result of the above code example.

N> allowFreezeSwimlane is applicable when swim lane grouping enabled by setting swimlaneKey.