jQuery MiniUI

标题: 怎么样用JS控制DIV的大小 [打印本页]

作者: 冰是睡着的雪    时间: 2018-7-6 12:00:23     标题: 怎么样用JS控制DIV的大小

<div id="dfn_view_pxks_ktzj_detail" class="mini-datagrid" style="width: 100%; height: 100%;"
                                        visible="true" allowalternating="false" pagesize="10" showpager="true" allowcellselect="true"
                                        multiselect="true" idfield="questionid" sortfield="questioncontent" sortorder="desc">
                                        <div property="columns">
                                            <div type="checkcolumn">
                                            </div>
                                            <div type="indexcolumn">
                                            </div>
                                            <div field="questioncontent" header="试题内容" allowsort="true" width="250px">
                                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                            </div>
                                            <div field="questiontype" header="类型" allowsort="true" width="50px">
                                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                            </div>
                                            <div field="answer" header="答案" allowsort="true" width="50px">
                                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                            </div>
                                        </div>
                                    </div>
                                    <div id="Div1" class="mini-datagrid" allowcellwrap="false" style="width: 100%; height: 35%;"
                                        allowresize="true" allowcelledit="false" multiselect="true" showpager="false"
                                        idfield="questionid" autoload="false" url="/Form/GridPageLoadEx" sortfield="questioncontent">
                                        <div property="columns">
                                            <div type="indexcolumn" width="20px">
                                            </div>
                                            <div field="questioncontent" header="试题内容" allowsort="true" width="250px">
                                                <input property="editor" class="mini-textbox" style="width: 100%;" />
                                            </div>
                                        </div>
                                    </div>



      var zy = function() {
            if (document.getElementById("dfn_view_pxks_ktzj_detail").style.height == "100%") {
                document.getElementById("dfn_view_pxks_ktzj_detail").style.height = "65%";

                mini.get("Div1").setData([]);
                jq = 1
            } else {
                jq = 0;
                document.getElementById("dfn_view_pxks_ktzj_detail").style.height = "100%"

            }

        }



我觉得没什么问题
但是[attach]11072[/attach][attach]11073[/attach]
触发JS的时候,下面的分页栏不见了,被挡住了呢。
请问是什么原因。我该怎样修改代码呢。


作者: dforce    时间: 2018-7-6 13:51:41

MiniUI控件,请使用MiniUI的方法控制
mini.get(id).setHeight(height)




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2