15

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.

Community
  • 1
  • 1
mlusiak
  • 1,054
  • 14
  • 28

2 Answers2

34

You have forgotten to include the jqgrid-specific css-file! After including this file your problem is solved.

hagen
  • 356
  • 2
  • 2
10

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
  • 220,925
  • 34
  • 403
  • 798
  • 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. – mlusiak Oct 29 '10 at 15:02
  • @kMike For me, the problem with the overlay began when I upgraded from jQuery 1.4.1 to 1.5.2. I was on version 3.6.4 of jqGrid and didn't have time to switch to 4.0.0. Oleg's fix worked for me. – grahamesd Apr 27 '11 at 19:22