Author Topic: Column width  (Read 122 times)

pbassey

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 41
    • View Profile
Column width
« on: December 14, 2024, 10:55:12 pm »
I am trying to figure out how to set a column to a specific width.  When I use, width: 10, inside the colModel definition, it does not appear to have an effect. Below is what I have in my javascript:

    var colModel = [
        {
            title: "Actions", dataType: "string", dataIndx: "ID", editable: false, align: "left", width: 10, wrap: false
            , render: function (ui) {
                var DocId = ui.cellData;
                return "<button type='button' onClick=javascript:getDocuments(" + DocId + ") class='btn btn-primary'><i class='bi bi-file-earmark-pdf' data-bs-toggle='tooltip' data-bs-placement='bottom' title='Click here to download this document.'></i></button>"
                    + "";
            }
        },
        { title: "Document Name", dataType: "String", width: 500, wrap: true, dataIndx: "DocName", editable: false },
        { title: "Resource Category", dataType: "string", dataIndx: "categoryDesc", editable: false },
        { title: "Document Date", dataType: "string", dataIndx: "DocDateTime", editable: false },
        { title: "Document Desc", dataType: "string", dataIndx: "DocDesc", width: 200, editable: false }
    ];

What can I do to always make the first column 10px long?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6323
    • View Profile
Re: Column width
« Reply #1 on: December 14, 2024, 10:58:27 pm »
you also need to set column.minWidth

https://paramquery.com/pro/api#option-column-minWidth