jQWidgets Forums

jQuery UI Widgets Forums Grid Column width "Auto" no longer works

This topic contains 12 replies, has 3 voices, and was last updated by  Peter Stoev 11 years, 6 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
  • Column width "Auto" no longer works #28293

    Karl
    Participant

    You used to be able to have a column fill width auto but now this does not work in version 3.02

    Column width "Auto" no longer works #28294

    Karl
    Participant

    that is set column width attribute to “auto”

    Column width "Auto" no longer works #28296

    Peter Stoev
    Keymaster

    Hi Karl,

    There has never been such built-in setting for a width. If you want “auto” behavior”, don’t set the width.

    Best Regards,
    Peter Stoev

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

    Column width "Auto" no longer works #28360

    Karl
    Participant

    thanks peter, I was wondering why I could not find it in documentation. I had been using this attribute, it must have been ignoring it.

    thanks for your help,
    remove this topic if you want

    thanks

    Column width "Auto" no longer works #28372

    Peter Stoev
    Keymaster

    Hi Karl,

    No, problem. For auto width, leave the column’s width unset and it should work.

    Best Regards,
    Peter Stoev

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

    Column width "Auto" no longer works #28524

    Karl
    Participant

    Peter, I tried leaving column width empty and it doesn’t work either? Am I missing something? This example has a single column and a button column. The grid is 300px wide, the button column is set to 50px but the first column ‘tradeid’ renderd at only 52px wide, i’d expect it to be approx 250px

    $(“#jqxTrades”).jqxGrid(
    {
    source: tradeDataAdapter,
    theme: theme,
    width: 300,
    autoheight: true,
    editable: true,
    editmode: ‘dblclick’,
    sortable: true,
    showsortcolumnbackground: false,
    columns: [
    { text: ‘TradeId’, datafield: ‘TradeId’, hidden: true, editable: false },
    { text: ‘Trade’, datafield: ‘TradeName’, editable: true },
    {
    text: ”, datafield: ‘Delete’, width: 50, columntype: ‘button’, cellsrenderer: function () {
    return “Delete”;
    }, buttonclick: function (row) {
    // get the clicked row’s data and initialize the input fields.
    var dataRecord = $(“#jqxTrades”).jqxGrid(‘getrowdata’, row);
    if (dataRecord.TradeName == “General”) {
    //cannot delete
    displayAlert(‘Sorry, Cannot delete “General” Trade’);
    return;
    }
    $.ajax({
    type: “POST”,
    url: serviceURL + ‘/DeleteTrade’,
    data: JSON.stringify({ TradeId: dataRecord.TradeId }),
    contentType: “application/json; charset=utf-8”,
    dataType: “json”,
    processdata: true,
    success: function (result) {
    if (result == “OK”) {
    $(‘#jqxTrades’).jqxGrid(‘deleterow’, $(‘#jqxTrades’).jqxGrid(‘getrowid’, row));
    resetCache();
    $(‘#’ + cmbTradeId).data(‘dataBind’)();
    } else {
    alert(result);
    }
    },
    error: function (result) {
    alert(“sorry an unexpected error occurred”);
    }
    });
    }
    }
    ]
    });

    Column width "Auto" no longer works #28526

    Karl
    Participant

    release note for 3.02 states this:

    – Fixed an issue in jqxGrid regarding the column width calculation when the column’s width is not set.

    so it seems functionality has changed in this version?

    Column width "Auto" no longer works #28527

    Peter Stoev
    Keymaster

    Hi Karl,

    We fixed an issue regarding the width calculation and now it works better.

    Best Regards,
    Peter Stoev

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

    Column width "Auto" no longer works #28635

    Karl
    Participant

    Thanks again for your input,

    I’ve managed to further isolate the issue.

    The issue occurs when using a remote data source and the previous column is hidden.

    I’m guessing with remote data source and your change to column sizing may work differently with remote binding.

    I cant attach files for a demo but simply change the column definitions in the demo bindingtojsonp.htm

    columns: [
    { text: ‘Country Name’, datafield: ‘countryName’,hidden:true },
    { text: ‘City’, datafield: ‘name’},
    { text: ‘Population’, datafield: ‘population’, cellsformat: ‘f’, width: 170 },
    { text: ‘Continent Code’, datafield: ‘continentCode’, width: 100 }
    ]

    hiding first column and setting second to auto width fails in this case. if you show first column the second column does fill width.

    Column width "Auto" no longer works #28639

    Karl
    Participant

    my interim solution was simply to move my hidden column to last in list. having that hidden column at the start in conjuction with remote source is problematic.

    Column width "Auto" no longer works #28640

    Peter Stoev
    Keymaster

    Hi Karl,

    Thanks for the feedback. If we verify your feedback, we will add a work item.

    Best Regards,
    Peter Stoev

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

    Column width "Auto" no longer works #49287

    elcarajo
    Participant

    Hi Peter,

    I’m also trying to set auto column widths, but I noticed that the widths set are based only on the length of the header texts. Is there a way to set them based on the same calculation CSS uses for width=’auto’?

    Column width "Auto" no longer works #49288

    Peter Stoev
    Keymaster

    Hi elcarajo,

    No, it is not possible to modify the calculation behavior.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.