This is a problem we are facing: The horizontial scrollbar does not render when the grid height is set. We want these features enabled:
- Grid height of 400px- Fixed Headers- Grid width of 100%- If columns exceed the width, render a horizontal scrollbar.- If data exceeds the height, render a vertical scrollbar.
The example is even broken in your JSFIDDLE.
http://jsfiddle.net/gh/get/jquery/1.9.1/igniteuisamples/jsfiddle-samples/tree/master/EN/HtmlSamples/grid/overview-sample/
Go to the link and replace the grid declaration with the following grid below. You will notice:
- vertical scrollbar is available.- horizontal scrollbar is missing.- Horizontal scrollbar appears if and only if you start to shrink the page by making the browser smaller.
This is a serious problem for us. What work around do you have to fix this issue?
v14.2
IE11 + Firefox
$("#grid").igGrid({ primaryKey: "ProductID", width: '100%', columns: [ { key: "Id", dataType: "number", width: "50px", headerText: "blah", hidden: false }, { key: "LocationId", dataType: "number", width: "50px", headerText: "blah", hidden: false }, { key: "CustomerId", dataType: "number", width: "50px", headerText: "blah", hidden: false }, { key: "OrderLocationId", dataType: "number", width: "50px", headerText: "blah", hidden: false }, { key: "OrderStateId", dataType: "number", width: "50px", headerText: "blah", hidden: false }, { key: "Customer", dataType: "object", width: "50px", headerText: "blah", hidden: false }, { key: "OrderLocation", dataType: "object", width: "50px", headerText: "blah", hidden: false }, { key: "OrderItems", dataType: "object", width: "50px", headerText: "blah", hidden: false }, { key: "ShipDate", dataType: "date", format: "MM/dd/yyyy", width: "75px", headerText: "Ship Date", unbound: true, formula: function (record, grid) { return "test";//return $.ig.formatter(record.Customer.ShipDate, "date", "MM/dd/yyyy", true, true, null); } }, { key: "FreightCarrier", dataType: "string", width: "120px", headerText: "FreightCarrier", unbound: true, formula: function (record, grid) { return "test";//return record.Customer.CarrierDescription; } }, { key: "PaymentType", dataType: "string", headerText: "Pre-Paid / Collect / 3rd Party Payment Terms" }, { key: "LocationNumber", dataType: "string", width: "65px", headerText: "PC #", unbound: true, formula: function (record, grid) { return "test";//return record.OrderLocation.LocationNumber; } }, { key: "ReferenceNumber", dataType: "string", width: "75px", headerText: "PO or SOor Ref #", unbound: true, formula: function (record, grid) { return "test";// //var references = ""; //if (record.Customer.SalesOrderNumber) { // references = references + "SO: " + record.Customer.SalesOrderNumber + "\r\n"; //} //if (record.Customer.PurchaseOrderNumber) { // references = references + "PO: " + record.Customer.PurchaseOrderNumber + "\r\n"; //} //return references; } }, //{ // key: "ProNumber", dataType: "string", headerText: "Pro Number", // width: "65px", // unbound: true, // formula: function (record, grid) { // return ""; // } //}, { key: "ShipperName", dataType: "string", headerText: "ShipperName", width: "120px", unbound: true, formula: function (record, grid) { return "test";// //return record.OrderLocation.LocationName; } }, { key: "ShipperAddress", dataType: "string", headerText: "ShipperAddress", width: "120px", unbound: true, formula: function (record, grid) { return "test";//return record.OrderLocation.ShippingAddress; } }, { key: "ConsigneeName", dataType: "string", headerText: "ConsigneeName", width: "95px", unbound: true, formula: function (record, grid) { return "test";// return record.Customer.ConsignedTo; } }, { key: "ConsgineeAddress", dataType: "string", headerText: "ConsigneeAddress", width: "120px", unbound: true, formula: function (record, grid) { return "test";//return record.Customer.Address1 + ' ' + record.Customer.Address2 ? record.Customer.Address2 : ""; } }, { key: "ConsigneeCity", dataType: "string", headerText: "ConsigneeCity", width: "85px", unbound: true, formula: function (record, grid) { return "test";//return record.Customer.City; } }, { key: "ConsigneeState", dataType: "string", headerText: "ConsigneeState", width: "65px", unbound: true, formula: function (record, grid) { return "test";// return record.Customer.State; } }, { key: "ConsigneeZip", dataType: "string", headerText: "ConsigneeZip", width: "75px", unbound: true, formula: function (record, grid) { return "test";// return record.Customer.Zip; } } ], autoGenerateColumns: false, dataSource: northwindProducts, responseDataKey: "results", autoCommit: true, height: "400px" }); });
Hello Karthik,
In order to display horizontal scrollbar the grid columns' width sum should exceed the grid width or you can place the grid table element inside of div element and set the grid width to 100%, for example:
<div style="width:400px"> <table id="grid"></table> </div>
...
$("#grid").igGrid({ width: '100%',
});
If you need further assistance, please let me know.
Regards,Tsanna
That won't work for a fluid layout. If we restrict the grid by a container then what happens when a user visits the page with a maximized window? They would expect to be able to see the entire grid at that point. What other alternatives are there?
We use bootstrap for our grid design. Sample row:
<div class="row"> <div class="col-md-12"> <table id="igGridOrders"></table> </div> </div>
Okay we conceded. We added a 400px width constraint. Attached is how it looks.
Seriously, is this acceptable for other customers?
I guess a positive note is that the horizontal scrollbars are now showing up.
So we support all screen sizes. So we set the width to an appropriate size to match full screen, then customers with smaller screens see this:
So I removed the changes and now it is scrolling correctly with 100% width set. Standby I need to replicate this behavior - this not working but now working stuff is taxing.
I noticed that in the fiddle you posted earlier one of the columns didn't have width set. The grid will require all columns to have widths set in pixels for the scrollbar to appear when the grid itself has a width in percents. Could you please check the corrected fiddle and see if it fulfills your requirements?
Best regards,
Stamen Stoychev
Which column didn't have a width? I checked all of them and all of the visible columns have widths defined.
The example is perfect. But I can't seem to replicate it on some our grids.
Hello Daniel,
Thank you for your feedback and I'm glad you were able to resolve the issue.
If I can provide you with further assistance, feel free to contact me.
Regards,
Tsanna
The issue was stemmed from the us setting this value to false:
enableResizeContainerCheck
We've enabled the feature in our base configuration and it is resizing correctly.
thanks!
You can change the path to the js and css files, so that they point to the directory where they are located on your machine or just use the combined script references as in the jsFiddle. If you have any further questions, please let me know.
Any updates on this?
The demo doesn't work. I think it is referencing local files that aren't included in the zip file.