Home > Web Front-end > JS Tutorial > How to make easyui gridview width adaptive window change and fitColumns application_javascript skills

How to make easyui gridview width adaptive window change and fitColumns application_javascript skills

WBOY
Release: 2016-05-16 17:42:46
Original
1201 people have browsed it

When using Easyui GridView, if you want the width of the Gridview to be the same as the width of the window, you only need to set fitColumns: true
After this is implemented, if the window is resized, the width of the gridview will not change. We just need to do it ourselves. Add a resize event to the window and let the gridview change the width in the event callback method:

Copy the code The code is as follows:

//After adjusting the window size, set easyui gridview to also adjust the width
$(window).resize(function () {
$('#gvManage').datagrid(' resize');
});
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template