tags:

views:

18

answers:

1

I come to next problem after this post.

After loading data, gray overlay covers everything on page, but grid data. The css div id responsible for that is lui_list. Any idea, how to solve this?

That's how I'm running jqgrid scirpt:

<script type="text/javascript">
    jQuery(document).ready(function() {
        jQuery("#list").jqGrid({
            url: '/Ticket/All/',
            datatype: 'json',
            mtype: 'GET',
            colNames: ['Id', 'Hardware', 'Issue', 'IssueDetails', 'RequestedBy', 'AssignedTo', 'Priority', 'State'],
            colModel: [
          { name: 'Id', index: 'Id', key: true, width: 100 },
          { name: 'Hardware', index: 'Hardware', width: 100 },
          { name: 'Issue', index: 'Issue', width: 200 },
          { name: 'IssueDetails', index: 'IssueDetails', width: 200 },
          { name: 'RequestedBy', index: 'RequestedBy', width: 150 },
          { name: 'AssignedTo', index: 'AssignedTo', width: 150 },
          { name: 'Priority', index: 'Priority', width: 100 },
          { name: 'State', index: 'State', width: 100}],
            pager: jQuery('#pager'),
            rowNum: 10,
            rowList: [5, 10, 20, 50],
            sortname: 'Id',
            sortorder: "desc",
            viewrecords: true,
            imgpath: '/Content/images/',
            caption: 'My first grid'
        });
    }); 
</script>

<h2>My Grid Data</h2>
<table id="list"></table>
<div id="pager"></div>

And html header:

<link href="/Content/jquery-ui-1.8.5.custom.css" rel="stylesheet" type="text/css"  />
<link href="/Content/ui.jgrid.css" rel="stylesheet" type="text/css"  />
<script type="text/javascript" src="/Scripts/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/Scripts/jquery-ui-1.8.5.custom.min.js"></script>
<script type="text/javascript" src="/Scripts/grid.locale-en.js" ></script>
<script type="text/javascript" src="/Scripts/jquery.jqGrid.min.js" ></script>

Any help will be appreciated.

+1  A: 

I don't know why the overlay will stay displayed after the end of loading. I can only suppose that you use some CSS classes like "loading" used also during loading of jqGrid. Independent from the reason you can fix the problem very easy. You should just hide the corresponding div with the following code for example:

var grid_id = "list"; // jQuery("#list")[0].id;
var hideLoading = function () {
    jQuery("#lui_"+grid_id).hide();
    jQuery("#load_"+grid_id).hide();
}

jQuery("#list").jqGrid({
    // all current options
    loadComplete: function() {
        hideLoading();
    },
    loadError: function() {
        hideLoading();
    }
});
Oleg
Hi Oleg. Thanks again for your help. This indeed solves the problem. I will vote up, but wait with marking as answer - maybe somebody else will be able to find problem with overlay not hiding automatically.
kMike