jQWidgets Forums

jQuery UI Widgets Forums Grid Possible to Wrap column header?

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Possible to Wrap column header? #4636

    tatumandbell
    Member

    Hi, I have a column header with 2 words.
    { text: ‘Records Requested’, datafield: ‘RecordsRequested’, width: 130, columntype: ‘checkbox’ },

    Since it’s a checkbox column screen space would be saved if I could render the column header as
    Records
    Requested

    I tried text: ‘RecordsRequested’
    but it made the word “requested” disappear.

    Please let me know if this is possible as I am wasting a lot of width on some columns that could wrap the headers instead to save space.

    Possible to Wrap column header? #4638

    Peter Stoev
    Keymaster

    The solution is:

    Set the column’s text field to: RecordsRequested. However, the column header’s height is defined by the value of the Grid’s columnsheight property. To change the height of the columns header, you need to set that property, too.

    For example:

                // initialize jqxGrid
    $("#jqxgrid").jqxGrid(
    {
    width: 670,
    source: source,
    theme: theme,
    columnsheight: 50,
    columns: [
    { text: 'First Name', datafield: 'firstname', width: 100 },
    { text: 'Last Name', datafield: 'lastname', width: 100 },
    { text: 'Product', datafield: 'productname', width: 180 },
    { text: 'Records<br/>Requested', datafield: 'available', columntype: 'checkbox', width: 80 },
    { text: 'Quantity', datafield: 'quantity', width: 80, cellsalign: 'right' },
    { text: 'Unit Price', datafield: 'price', width: 90, cellsalign: 'right', cellsformat: 'c2' },
    { text: 'Total', datafield: 'total', width: 100, cellsalign: 'right', cellsformat: 'c2' }
    ]
    });

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.