jQWidgets Forums

jQuery UI Widgets Forums Grid Grid Height is not what I am expecting

Tagged: ,

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 8 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Grid Height is not what I am expecting #91216

    jacobraccuia
    Participant

    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":""}]

    height wrong

    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.

    Grid Height is not what I am expecting #91222

    Peter Stoev
    Keymaster

    Hi jacobraccuia,

    You did not set the “height” property of the Grid so it defaults to 400px.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Grid Height is not what I am expecting #91329

    jacobraccuia
    Participant

    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?

    Grid Height is not what I am expecting #91338

    Peter Stoev
    Keymaster

    Hi jacobraccuia,

    If you have a few rows, you can set autoheight: true.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.