EasyUI Forum
May 02, 2024, 10:08:11 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: 1 2 3 [4]
46  General Category / EasyUI for jQuery / Re: DataGrid request the url twice. on: October 06, 2015, 05:46:04 AM
Can anybody help me?
47  General Category / EasyUI for jQuery / datagrid can't show illegal character. on: October 06, 2015, 03:06:28 AM
Hi,
There can't display data with the datagrid when json data include illegal character.
How can realize display illegal character in some special needs.


Code:
{"total":1,"rows":[{"logid":"97033","contents":"\0","ip":"127.0.0.1","builddate":"2015-10-06 17:51:34","emname_st":"abc","sysfunname_cn":""}]}
48  General Category / EasyUI for jQuery / DataGrid request the url twice. 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":[]}
49  General Category / EasyUI for jQuery / Re: DataGrid checkbox question. on: October 04, 2015, 05:26:07 AM
If you get all rows checked, the 'checked' property values in all rows are surely true. Please refer to this example http://jsfiddle.net/55a5nsq9/. It works fine.

Thank you.
Your code works fine.
Maybe I know the cause.Like bottom of the code.The id=5 is fine.The checkbox is not check,but the id=4 is not fine.
'false' and false.
Add the single quotes and no single quotes.if no single quotes it's fine. but add single quotes it's not fine.it's checked.
Why?

Code:
var data = [
          { id: 1, sysfunnumber: 'sysfunnumber1' },
          { id: 2, sysfunnumber: 'sysfunnumber2', checked: 'true' },
          { id: 3, sysfunnumber: 'sysfunnumber3', checked: 'true' },
          { id: 4, sysfunnumber: 'sysfunnumber4', checked:'false' },
          { id: 5, sysfunnumber: 'sysfunnumber5', checked: false }
        ]
50  General Category / EasyUI for jQuery / Re: DataGrid checkbox question. on: October 04, 2015, 03:41:16 AM
What is the data returned from '/Box/Company/GetJsonFunctionGrid'? Please check the 'checked' property value in each rows.

O,Thank you reply to me,I waiting for someone reply to me all day.this question prevent me go on several days.
The 'checked' property value only two rows are true,other 98 rows are false.
I annotation bottom of the code. Every rows checkbox are checked. i don't know why.

Code:
if (data) {
                    $.each(data.rows, function (index, item) {
                        if (item.checked) {
                            $('#gridmaster').datagrid('checkRow', index);
                        }
                    });
                }
51  General Category / EasyUI for jQuery / DataGrid checkbox question. on: October 03, 2015, 08:02:58 AM
Hi all,

In my page,there have one datagrid component,the first column is checkbox.
When the data load,only two data checked value are true,all the others are false,but the datagrid display each row is selected.
Please help me.
Thank you.

Code:

<table id="gridmaster"></table>

<script>
    $(function () {
        $('#gridmaster').datagrid({
            title: '',
            url: '/Box/Company/GetJsonFunctionGrid',
            method: 'get',
            width: '700',
            rownumbers: true,
            columns: [[
                { field: 'ck', checkbox: true },
                { field: 'sysfunnumber', title: 'sysfunnumber' }
            ]],
            queryParams: {
                        id: id,
            },
            singleSelect: false,
            selectOnCheck: true,
            checkOnSelect: true,
            onLoadSuccess: function (data) {
                if (data) {
                    $.each(data.rows, function (index, item) {
                        if (item.checked) {
                            $('#gridmaster').datagrid('checkRow', index);
                        }
                    });
                }
            }
        });
    });
</script>
52  General Category / Bug Report / Re: Two datagrid on one page,sometime the one show data the other can not show data. on: September 27, 2015, 09:30:43 PM
Yes.there no problems with the code.
I opened browse's debug tool.There no detect error.
The data load data from the sqlserver.but can't show data in frontend.
If switch the order. the 'gridmaster' can't display data,the 'gridleft' is normal.
I clear the class="easyui-datagrid" property both of them.
'gridmaster'  and 'gridleft' display data is normal.

53  General Category / Bug Report / Two datagrid on one page,sometime the one show data the other can not show data. on: September 25, 2015, 11:23:19 PM
Two easyui datagrid on the one page.
The page's 'gridmaster' is successful show data, but the 'gridleft' can not do it.
I check it step by step.when I clear the gridmaster and gridleft class="easyui-datagrid".
like this:
<div id="gridleft" inline="true"></div>
<div id="gridmaster" inline="true"></div>
both of them are successful.

I don't know why?




<div id="tb" style="padding:0px;height:auto">
    <div>
        Code: <input id="btnum" class="easyui-textbox pagetextbox" type="text">
        Name: <input id="btnname" class="easyui-textbox pagetextbox" type="text">
        Status:<select id="comstatus" class="easyui-combobox" editable="false" name="state" style="width:70px;">
            <option value="-1">All</option>
            <option value="0">Normal</option>
            <option value="1">Expire</option>
        </select>
        <a id="btnLoad" href="#" class="easyui-linkbutton" iconcls="icon-search" onclick="doSearchPage()">Query</a>
    </div>
</div>
<div id="ptmain_layout" class="easyui-layout" data-options="fit:true" style="width:100px;height:100px;">
    <div id="ptp1" data-options="region:'west',split:false" title="Function List" style="width:20%;padding:0px">
        <div id="gridleft" class="easyui-datagrid" inline="true"></div>
        </div>
        <div id="ptp2" data-options="region:'center'" title="Detail Information">
            <div id="gridmaster" class="easyui-datagrid" inline="true"></div>
        </div>
 </div>



    <script>
        $(function () {
            var height1 = $(window).height();
            $("#ptmain_layout").attr("style", "width:100%;height:" + height1 + "px");
            $("#ptmain_layout").layout("resize", {
                width: "100%",
                height: height1 + "px"
            });
        
            $('#gridleft').datagrid({
                title: '',
                url: '/Box/PowerType/TypeReload',
                method: 'get',
                dataType: "json",
                collapsible: true,
                fit: true,
                fitColumns: true,
                rownumbers: true,
                striped: true,
                view: scrollview,
                autoRowHeight: false,
                remoteSort: false,
                columns: [[
                    { field: 'type_number', title: 'Code', hidden: true },
                    { field: 'type_name', title: 'Name', width: '150px' }
                ]],
                singleSelect: true,
                onLoadSuccess: function (data2) {
                    if (data2.rows.length > 0) {
                        $(this).datagrid("selectRow", 0);
                    }
                },
                onClickRow: function (rowIndex, rowData) {
                    doSearchPage();
                }
            });




            $('#gridmaster').datagrid({
                title: '',
                url: '/Box/PowerType/Reload',
                method: 'get',
                dataType: "json",
                fit: true,
                toolbar: '#tb',
                fitColumns: true,
                rownumbers: true,
                striped: true,
                view: scrollview,
                autoRowHeight: false,
                pageSize: 20,
                pagination: false,
                remoteSort: false,
                columns: [[
                    { field: 'sp_id', hidden: true, title: 'ID' },
                    { field: 'sp_number', title: 'Code', width: '140px', sortable: true },
                    { field: 'sp_name', title: 'Name', width: '150px', sortable: true },
                    { field: 'sp_default', title: 'Default Value', width: '50px', sortable: true }
                ]],
                queryParams: {
                    typenumber: '0',
                    number: $('#btnum').val(),
                    name: $('#btnname').val(),
                    status: $('#comstatus').combobox('getValue'),
                },
                singleSelect: true,
                selectOnCheck: false,
                checkOnSelect: false,
                onLoadSuccess: function (data) {
                    if (data.rows.length > 0) {
                        $('#gridmaster').datagrid("selectRow", 0);
                    }
                }
            });

    });
Pages: 1 2 3 [4]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!