Home  >  Article  >  Web Front-end  >  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
WBOYOriginal
2016-05-16 17:42:461161browse

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');
});
Statement:
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