Forum


11:34

02/04/2009

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
05:35

Moderators
30/10/2007

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.
10:26

05/02/2009

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>
19:32

11/05/2009

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
12:35

Moderators
30/10/2007

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66