jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Grid Height is not what I am expecting
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 8 years, 4 months ago.
-
Author
-
If you look at the attached image, the height is not what I am expecting. There are a ton of blank rows.
Here is the code I am using:
var source = { localdata: data, datatype: "json" }; $('#contactGrid').jqxGrid({ width: '1100px', source: source, columnsResize: true, filterable: true, sortable: true, groupable: true, groups: ['groupName'], columns: [ { text: 'Group', dataField: 'groupName', width: '250' }, { text: 'Type', dataField: 'recordType', width: '100' }, { text: 'First Name', dataField: 'firstName', width: '200' }, { text: 'Last Name', dataField: 'lastName', width: '200' }, { text: 'Title', dataField: 'title', width: '250' }, { text: 'View', dataField: 'Id', width: '70', cellsrenderer: viewField }, ] });
and here is the data itself, coming from an ajax call. I ran a console.log() to get this.
[{"firstName":"Wonder","groupName":"Golden Lasso Group","Id":"0035C000002JuEiQAK","lastName":"Woman","name":"Wonder Woman","recordType":"Contact","title":""},{"firstName":"Defender","groupName":"Unassigned","Id":"0035C000002JuCsQAK","lastName":"of Universe","name":"Defender of Universe","recordType":"Contact","title":""},{"firstName":"Captain","groupName":"Golden Lasso Group","Id":"0035C000002vJ6nQAE","lastName":"America","name":"Captain America","recordType":"Contact","title":"Sir"},{"firstName":"Bruce","groupName":"Unassigned","Id":"00Q5C000001MJmeUAG","lastName":"Wayne","name":"Bruce Wayne","recordType":"Lead","title":""}]
I DO have another grid on the page. I have a treegrid on the page. It does not have a fixed height either, and it works as intended. They have unique IDs. Everything else seems to be working as I’d expect.
Hi jacobraccuia,
You did not set the “height” property of the Grid so it defaults to 400px.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/What if there are only a few rows? Is it possible to have a max height and have it default to the number of rows in the grid?
Hi jacobraccuia,
If you have a few rows, you can set autoheight: true.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.