EasyUI Forum
May 18, 2024, 12:01:02 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Poll
Question: DataGrid request the url twice.
DataGrrid - 0 (0%)
Scrollview - 1 (100%)
Total Voters: 1

Pages: [1]
  Print  
Author Topic: DataGrid request the url twice.  (Read 5631 times)
frankgao
Jr. Member
**
Posts: 53


View Profile Email
« on: October 06, 2015, 02:00:24 AM »

Hi,
One datagrid request data and bind.
if there have json data return to frontend from my server-side. The Datagrid request the url once, it's normal.
but there no json data reuturn the datagrid request twice from server.
I used Fiddler Web Debugger tool and sqlserver profiler watch this motion.


Code:
<div id="tb" style="padding:0px;height:auto">
    <div>
        Name: <input id="btnum" class="easyui-textbox pagetextbox" type="text">
        Content: <input id="btnname" class="easyui-textbox pagetextbox" type="text">
        Date: <input class="easyui-datetimebox" editable="false" name="btbegintime" id="btbegintime" style="width:145px" />
        To <input class="easyui-datetimebox" editable="false" name="btendtime" id="btendtime" style="width:145px" />
        <a id="btnLoad" href="#" class="easyui-linkbutton" iconcls="icon-search" onclick="doSearchPage()">Query</a>
    </div>
</div>
<div id="gridmaster"></div>
<script>
    $(function () {
        $('#btbegintime').datetimebox('setValue', '2015-10-06 00:00:00');
        $('#btendtime').datetimebox('setValue', '2015-10-06 23:59:59');

        $('#gridmaster').datagrid({
            title: '',
            url: '/Box/Log/Reload',
            method: 'get',
            dataType: "json",
            fit: true,
            toolbar: '#tb',
            fitColumns: true,
            rownumbers: true,
            striped: true,
            view: scrollview,
            autoRowHeight: false,
            pageSize: 25,
            pagination: false,
            remoteSort: false,
            columns: [[
                { field: 'logid', hidden: true, title: 'ID' },
                { field: 'sysfunname_cn', title: 'sysfunname_cn', width: '120px', sortable: true },
                { field: 'contents', title: 'contents', width: '300px', sortable: true },
                { field: 'ip', title: 'IP', width: '90px', sortable: true },
                { field: 'emname_st', title: 'emname_st', width: '80px' },
                { field: 'builddate', title: 'builddate', width: '130px' }
            ]],
            queryParams: {
                number: $('#btnum').val(),
                name: $('#btnname').val(),
                begintime: $('#btbegintime').datetimebox('getValue'),
                endtime: $('#btendtime').datetimebox('getValue')
            },
            singleSelect: true,
            selectOnCheck: false,
            checkOnSelect: false,
            onLoadSuccess: function (data) {
                if (data.rows.length > 0) {
                    $('#gridmaster').datagrid("selectRow", 0);
                }
            }
        });
    });


    function doSearchPage() {
        $("#gridmaster").datagrid('load', {
            number: $('#btnum').val(),
            name: $('#btnname').val(),
            begintime: $('#btbegintime').datetimebox('getValue'),
            endtime: $('#btendtime').datetimebox('getValue')
        });
    }


</script>

json data
Code:
  {"total":0,"rows":[]}
Logged
frankgao
Jr. Member
**
Posts: 53


View Profile Email
« Reply #1 on: October 06, 2015, 05:46:04 AM »

Can anybody help me?
Logged
frankgao
Jr. Member
**
Posts: 53


View Profile Email
« Reply #2 on: October 07, 2015, 09:38:39 PM »

It's very badly.
Used Datagrid with Basic DataGrid is normal.
Used Datagrid with Virtual Scroll View is request twice when first request is no data return.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!