Author Topic: Column with cell wrapping  (Read 143 times)

pbassey

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 41
    • View Profile
Column with cell wrapping
« on: December 14, 2024, 10:58:05 pm »
I am trying to figure out how to have document name field wrap the text inside the cell while sill only being 200px.  How do I do that??  Below is what I have:
    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: 200, 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 }
    ];

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6323
    • View Profile
Re: Column with cell wrapping
« Reply #1 on: December 14, 2024, 11:03:18 pm »
set 'white-space' property to 'normal' in column.style

Reference: https://paramquery.com/pro/demos/wrap