EasyUI Forum
April 30, 2024, 08:00:36 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: datagrid inside a window doesn't show remote content (1.5.4)  (Read 9429 times)
fgendorf
Newbie
*
Posts: 24


View Profile Email
« on: January 09, 2018, 07:56:31 AM »

Hi, I've just updated from version 1.5.3 to 1.5.4 and my datagrids located inside window doesn't show any content from a url... but if the datagrid is outside window, it works

If I comment line ur: 'url...' the columns shows but if not, the columns labels not appear.

I rollback to 1.5.3 and everything works again.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 09, 2018, 09:02:25 AM »

Please look at this example http://code.reloado.com/alifev3/edit#preview
Logged
fgendorf
Newbie
*
Posts: 24


View Profile Email
« Reply #2 on: January 09, 2018, 09:23:42 AM »

Hi, this example is not a remote content... the issue seems when url: parameter is present.

my code:

Code:
$('#listgroupsuser').datagrid({
    url: 'index.php?pg=getgroupsuser&uid=' + $('#uid').val(),
    singleSelect: true,
    toolbar: toolbargroup,
    height: 100,
    columns: [[
            {field: 'n', width: 20, fixed: true},
            {field: 'cn', title: 'Groups', width: 80}
        ]]
});

if use data works:

Code:
$('#listgroupsuser').datagrid({
    data: [{"n":1,"cn":"dev"},{"n":2,"cn":"Domain Users"},{"n":3,"cn":"esss"},{"n":4,"cn":"devjenkins"}],
    //url: 'index.php?pg=getgroupsuser&uid=' + $('#uid').val(),
    singleSelect: true,
    toolbar: toolbargroup,
    height: 100,
    columns: [[
            {field: 'n', width: 20, fixed: true},
            {field: 'cn', title: 'Groups', width: 80}
        ]]
});
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: January 09, 2018, 03:41:51 PM »

It also works fine when set the 'url' property. http://code.reloado.com/alifev3/2/edit#preview
Logged
fgendorf
Newbie
*
Posts: 24


View Profile Email
« Reply #4 on: January 10, 2018, 05:11:01 AM »

It also works fine when set the 'url' property. http://code.reloado.com/alifev3/2/edit#preview

Ok, in your case, the loader function get a local data, and it works.

In my code to work I needed use the follow loader:

Code:
loader: function (param, succ, error) {
        var opts = $(this).datagrid('options');
        $.ajax({
            type: opts.method,
            url: opts.url,
            data: param,
            dataType: 'json',
            success: function (data) {
                setTimeout(function () {
                    succ(data);
                }, 10);
            }
        });
    }

without setTimeout function, the result is the same of first post.
In version 1.5.3 it doesn't happen.

Thanks for your help
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: January 10, 2018, 07:34:48 AM »

The 'loader' only demonstrates the data loading from remote. This example works with the real 'url' to retrieve data from the remote server.
http://www.jeasyui.com/demo/test/test1.html

Code:
<div class="easyui-window" title="DataGrid" style="width:700px;height:250px">
    <table id="tt" class="easyui-datagrid" fit="true"
            url="../main/datagrid2_getdata.php"
            title="Load Data" iconCls="icon-save"
            rownumbers="true" pagination="true">
        <thead>
            <tr>
                <th field="itemid" width="80">Item ID</th>
                <th field="productid" width="120">Product ID</th>
                <th field="listprice" width="80" align="right">List Price</th>
                <th field="unitcost" width="80" align="right">Unit Cost</th>
                <th field="attr1" width="200">Attribute</th>
                <th field="status" width="60" align="center">Stauts</th>
            </tr>
        </thead>
    </table>
</div>
Logged
fgendorf
Newbie
*
Posts: 24


View Profile Email
« Reply #6 on: January 10, 2018, 09:34:12 AM »

Ok thanks, maybe my problem is my dynamic tabs on window, I will check it, but works in 1.5.3  Wink
Logged
gordis gmbh
Full Member
***
Posts: 103


View Profile Email
« Reply #7 on: January 24, 2018, 07:11:53 AM »

FYI:
There is a recent fix available in version 1.5.4.1 which also relates to display of Datagrid content in a window. May be it solves your problem as well.
Logged
fgendorf
Newbie
*
Posts: 24


View Profile Email
« Reply #8 on: January 29, 2018, 06:03:21 AM »

Oh Yes, 1.5.4.1 fixed the issue!

Thank you
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!