Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
only load grid on request
22/04/2009
11:34
Avatar
kritro
Member
Members
Forum Posts: 5
Member Since:
02/04/2009
sp_UserOfflineSmall Offline

Hello

Anyone have an idea what would be the best way to not show the grid when page is loaded and only show it based on an event, like click, and then with custom data set with for eks jQuery(”#grid_id”).setPostData( newdata).

I can ofcource show an empty grid and do an setPostData and triggerReload, but I hoped to not do that.

By the way, this is a great plugin that I've used several times.

kritro

25/04/2009
05:35
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Try hiddengrid:true. See docs and demos.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

15/05/2009
10:26
Avatar
violinssoundcool
Member
Members
Forum Posts: 35
Member Since:
05/02/2009
sp_UserOfflineSmall Offline

I'm having a similar issue.  I'm trying to get the grid to be hidden initially but then not hidden when an option is clicked on in a select box.  Right now, the grid is hidden when the page is loaded, but it stays hidden, and I can't get it to be shown unless I click the arrow in the top right corner.  Here is a basic version of my code:

<script language="JavaScript">
  
  function ElementWidth(elem)
  {
    var w = $(elem).outerWidth() -(8*5)-2
    alert(w);
    return w;
  }
       
  function ChangeWarehouse()
  {
    var warehouse;
    var surl;
    warehouse = document.getElementById("warehouse").value;
    if(warehouse=="")
    {
      warehouse="0";
    }
    surl ="RINVINQW2?warehouse="+warehouse;
    $('#results').setGridParam({url:surl, hiddengrid:false});
    $('#results').trigger("reloadGrid");
  }   
   
  $(document).ready(function()
  {
    $('#warehouse').focus();
    var columnNames = ['id','Customer','Quantity','Value'];
    var columnModel =
    [
      {name:'id', hidden:true, index:'id'},
      {name:'customer', resizable:false, index:'customer', width:300, align:'left'},
      {name:'quantity', resizable:false, index:'quantity', width:130, align:'center'},
      {name:'value', resizable:false, index:'value', align:'center', width:130},
    ];
               
    var gridwidth = $('.tableContainer').width();
    gridwidth = gridwidth-26;

    $("#results").jqGrid(
    {
      url: "rinvinqw2?warehouse="+document.getElementById("warehouse").value,
      datatype: "json",
      mtype: 'GET',
      gridstate: 'hidden',
      colNames: columnNames,
      colModel: columnModel,
      viewrecords: true,
      width: gridwidth,
      height: '350px',
      loadComplete: function()
      {
        var udata = $('#results').getUserData();
        $('#t_results').css("text-align","right").html("...");
        $('#cb').prev().remove();
        if($('#results').getGridParam("records")==0)
        {
          $('#noResults').dialog("open");
        }
        else
        {
          var page = $('#results').getGridParam("page");
          var records = $('#results').getGridParam("records");
          var recordsPP = $('#results').getGridParam("rowNum");
          var x = records/recordsPP;
          var returnArray = [];
          if(x < page)
          {
            iterLimit = records%recordsPP;
          }
          else
          {
            iterLimit = recordsPP;
          }
                           
          for(var i=1; i<=iterLimit; i++)
          {
           $('#'+i).children('td:first').next().addClass('link').css("cursor","pointer").css("color","blue").css("text-decoration","underline");
                               
            var ord = $('#'+i).children('td:first').next().text();
            $('#'+i).children('td:first').next().click(function()
            {
              ord = $(this).text();
              window.location.href = "RINVINQW2?warehouse="+warehouse;
            });
          }
        }
      },
                   
      subGrid: true,
      subGridRowExpanded: function(subgrid_id, row_id)
      {   
        ...

      });

      shrinkToFit: true,
      jsonReader:
      {
        root: "rows",
        page: "page",
        total: "total",
        records: "records",
        repeatitems : false
      }
    });
               
    function gridReload()
    {
      var warehouse = $('#warehouse').val();
     $('#results').setGridParam({url:"rinvinqw2?warehouse="+warehouse,page:1,hiddengrid:false}).trigger("reloadGrid");
    }
  });
</script>

18/05/2009
19:32
Avatar
prbabu
Member
Members
Forum Posts: 22
Member Since:
11/05/2009
sp_UserOfflineSmall Offline

Hi,

 Pretty much the same problem. I am doing this

jQuery('#list').setGridParam({ hiddengrid: false });

and then

 jQuery('#list').trigger("reloadGrid");

But still the grid is collapsed. How to expand the grid using grid method/properties?

Thanks for this great grid! Appreciate the time you put in.

-Praveen

20/05/2009
12:35
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

hiddengrid have effect only the first time when the gird is loaded. After that there is no effect. Also serch this forum for "HeaderButton" and you will find the answer.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
80 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information