Forum


23:12

03/10/2011

I have a jqGrid that contains grouping. For some reason, there is a particular group of data that only shows for some groups and not other groups? I have another working example that uses the jqGrid in the jqSuite and that always displays this particular group of data even for group bys that don't show in the in the standard jqGrid (not the one in the jqSuite). I s there something that I could be missing? In addition to all this, I can also see the json string in a hidden field so I am really lost as to why it is not being rendered? Any ideas? For example, is there any data that could possibly cause the jqGrid not render or ignore certaind data?
Thanks.
04:01

Moderators
30/10/2007

Hello,
As you can imagine we need a test case, otherviese no help.
Please understand that if we make test cases of all the issues described as you do we will not have
time to do anything else.
Hope you understand
Kind 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.
05:28

03/10/2011

tony said:
Hello,
As you can imagine we need a test case, otherviese no help.
Please understand that if we make test cases of all the issues described as you do we will not have
time to do anything else.
Hope you understand
Kind Regards
Tony
Makes sense. What exactly do you need? ASPX, Javascript code, and JSON string?
16:23

Moderators
30/10/2007

Hello,
The grid configuration with simple response is ok.
(In which browser is this problem?)
Kind 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.
17:12

03/10/2011

What is the best way to disable paging and bring back all rows? I am wondering if that is my issue? I am currently, defining my grid as follows, shouldn't this work? I get the data on server side because I need to get it for another server control, and convert it to a JSON string and store it in a hidden field. then on document.ready, I parse that JSON string and store it in a client side variable that is assigned as the data of the grid. As mentioned in my initial post, there are certain rows that get outputted sometimes and sometimes don't get output. However, if I look at the hiddenfield containing the JSON string, the rows that are not getting displayed all the time, are always present in the JSON string. Previously, I was using the jqSuite version of the jqGrid and did not see this issue with this same dataset. However, in that version, I was setting JQGrid1.PagerSettings.PageSize = (myDataset.Tables(0).Rows.Count * 2) to ensure that no paging occurred. I am not sure if this setting can be set with the client side version of jqGrid or if there is something else I need to look at? Thank you.
$(document).ready(function () {
GetValue();
});
function GetValue() {
holdings = JSON.parse($('#ctl00_ContentPlaceHolder1_ctH_hdnDataXML').val());
RenderGrid();
}
var holdings;
function RenderGrid() {
jQuery("#divHoldings").jqGrid({
colNames: ['Description', 'Symbol', 'Custodian', 'Account Type', 'Biz Line', 'Account', 'vchC360AccountName', 'Quantity', 'Price ($)', 'Value ($)', 'Pct. Assets (%)', 'Previous<br />Value ($)', '1-Day Price<br />Change (%)', 'Position Type', 'Tax Cost ($)', 'Tax Gain/Loss ($)', 'Tax Gain/Loss (%)', 'Principal ($)', 'Principal<br />Gain/Loss ($)', 'Principal<br />Gain/Loss (%)', 'Avg. Cost<br />Per Share ($)', 'Asset Type', 'Asset Category', 'Est. Annual<br />Income ($)', 'Current<br />Yield (%)', 'Dividend<br />Instructions', 'Capital Gain<br />Instructions', '', '', ''],
colModel: [
{ name: 'vchLongName', index: 'vchLongName', width: 325, align: "left", title: false },
{ name: 'vchTicker', index: 'vchTicker', width: 100, align: "left", title: false, formatter: FormatMenu },
{ name: 'Custodian', index: 'Custodian', width: 150, align: "left", title: false, hidden: true },
{ name: 'AccountType', index: 'AccountType', width: 150, align: "left", hidden: true, title: false },
{ name: 'BizLineDesc', index: 'BizLineDesc', width: 150, align: "left", hidden: true, title: false },
{ name: 'Account', index: 'Account', width: 150, align: "left", hidden: true, title: false },
{ name: 'vchC360AccountName', index: 'vchC360AccountName', width: 150, align: "left", hidden: true, title: false },
{ name: 'dQuantity', index: 'dQuantity', width: 150, align: "right", title: false, classes: 'PaddingRight20px', formatter: FormatNumberField, sorttype: 'number' },
{ name: 'mPrice', index: 'mPrice', width: 150, align: "right", title: false, formatter: FormatNumberField, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'mMarketValue', index: 'mMarketValue', width: 150, title: false, summaryType: 'sum', formatter: FormatNumberField, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'PercentMarketValue', index: 'PercentMarketValue', width: 150, align: "right", title: false, summaryType: 'sum', formatter: FormatNumberField, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'mPriorDayCloseValue', index: 'mPriorDayCloseValue', width: 150, align: "right", title: false, summaryType: 'sum', formatter: FormatNumberField, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'mChangeOneDay', index: 'mChangeOneDay', width: 150, align: "right", title: false, summaryType: 'sum', formatter: FormatNumberFieldAndAddColor, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'positiontype', index: 'PositionType', width: 150, align: "left", title: false },
{ name: 'mCostBasisWReInvest', index: 'mCostBasisWReInvest', width: 150, align: "right", title: false, formatter: FormatNumberField, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'mGainLossWInvest', index: 'mGainLossWInvest', width: 150, align: "right", title: false, formatter: FormatNumberFieldAndAddColor, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'pGainLossWInvest', index: 'pGainLossWInvest', width: 150, align: "right", title: false, formatter: FormatNumberFieldAndAddColor, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'mCostBasisWNOReInvest', index: 'mCostBasisWNoReinvest', width: 150, align: "right", title: false, formatter: FormatNumberField, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'mGainLossWNoInvest', index: 'mGainLossWNoInvest', width: 150, align: "right", title: false, formatter: FormatNumberFieldAndAddColor, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'pGainLossWNoInvest', index: 'pGainLossWNoInvest', width: 150, align: "right", title: false, formatter: FormatNumberFieldAndAddColor, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'mAvgCostPerShare', index: 'mAvgCostPerShare', width: 150, align: "right", title: false, formatter: FormatNumberField, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'AssetType', index: 'AssetType', width: 150, align: "left", title: false },
{ name: 'AssetCategory', index: 'AssetCategory', width: 150, align: "left", title: false },
{ name: 'EstimatedAnnualIncome', index: 'EstimatedAnnualIncome', width: 150, align: "right", title: false, summaryType: 'sum', formatter: FormatNumberField, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'CurrentYield', index: 'CurrentYield', width: 150, align: "right", title: false, summaryType: 'sum', formatter: FormatNumberField, classes: 'PaddingRight20px', sorttype: 'number' },
{ name: 'DividendInst', index: 'DividendInst', width: 150, align: "left", title: false },
{ name: 'CapGainsInst', index: 'CapGainsInst', width: 150, align: "left", title: false },
{ name: 'iPPSAccountID', index: 'iPPSAccountID', width: 150, align: "left", hidden: true, title: false },
{ name: 'UniqueID', index: 'UniqueID', width: 150, align: "left", hidden: true, title: false },
{ name: 'TotalMarketValue', index: 'TotalMarketValue', width: 150, align: "left", hidden: true, title: false }
],
altRows: true,
sortable: true,
datatype: "local",
data: holdings,
height: "auto",
gridview: true,
hoverrows: true,
grouping: true,
groupingView: {
groupField: ['vchC360AccountName'],
groupColumnShow: [false],
groupText: ['<b>{0}</b>'],
groupCollapse: false,
groupOrder: ['asc'],
groupSummary: [true],
showSummaryOnHide: true,
groupDataSorted: true
},
rowNum: -1,
authwidth: true
});
// Manage Group By
var groupVal = $("#ctl00_ContentPlaceHolder1_ctH_hdnGroupBy").val();
if ((! groupVal) || (groupVal == "")) {
jQuery("#divHoldings").jqGrid('groupingRemove', true);
}
else {
jQuery("#divHoldings").jqGrid('groupingGroupBy', groupVal);
}
// align Column header left
jQuery("#divHoldings").jqGrid ('setLabel', 'vchLongName', '', 'textalignleft');
jQuery("#divHoldings").jqGrid ('setLabel', 'vchTicker', '', 'textalignleft');
jQuery("#divHoldings").jqGrid ('setLabel', 'positiontype', '', 'textalignleft');
jQuery("#divHoldings").jqGrid ('setLabel', 'AssetType', '', 'textalignleft');
jQuery("#divHoldings").jqGrid ('setLabel', 'AssetCategory', '', 'textalignleft');
jQuery("#divHoldings").jqGrid ('setLabel', 'DividendInst', '', 'textalignleft');
jQuery("#divHoldings").jqGrid ('setLabel', 'CapGainsInst', '', 'textalignleft');
//check if we need to hide any columns
if ($("#ctl00_ContentPlaceHolder1_ctH_hdnHideShowColumns").val()) {
var columnsToHide = JSON.parse($("#ctl00_ContentPlaceHolder1_ctH_hdnHideShowColumns").val());
if (columnsToHide) {
for (var counter = 0; counter <= columnsToHide.length - 1; counter++) {
jQuery("#divHoldings").hideCol(columnsToHide[counter]);
}
jQuery("#divHoldings").trigger("reloadGrid");
}
}
}
17:59

03/10/2011

One more item on this. I am not 100% sure, but I think the row that does not get rendered is the last object/row in the JSON string if that row is going to generate a brand new group (i.e. a new group with only one row). However, if that last row/object does not generate a new group, i.e., it goes into a group that is already present, then that row does get rendered.
20:52

03/10/2011

I just tried changing the rowNum property from -1 to rowNum: 10000 and now the rows that sometimes don't get displayed are being displayed. I can easily calculate the number of rows/objects in my json string and assign that or a multiple of it as the value of rowNum property but I was under the assumption that setting the setting to -1 would return all the values. Can you please shed some light?
Thank you.
Most Users Ever Online: 715
Currently Online:
60 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