Recent Posts

Pages: 1 2 3 [4] 5 6 ... 10
31
Thank you for the details, I'm able to reproduce the issue.
32
Help for ParamQuery Pro / Re: pqGrid Excel Export – replace parameter
« Last post by paramvir on April 20, 2026, 07:14:21 pm »
  • The replace option is specifically designed for xlsx exports only; it will not function for other file formats.
  • The replace process occurs at a late stage where HTML content has already been escaped. Because of this, the string
Code: [Select]
<br>
    no longer exists in its original form when the regex runs, causing the replacement to fail.
  • The recommended alternative is to use the eachCell callback. This allows you to intercept and modify the cell value directly during the data iteration phase before any escaping or final formatting takes place.
Code: [Select]
var blob = await grid.exportData({
  format: format,
  nopqdata: true,
  render: false,
  sheetName: "Example",
  eachCell: function(cell) {
     //examine cell.value
  }
});
33
Customizing pqGrid Excel Export via Callbacks

Borders and row heights can be efficiently managed using the each* callbacks within the exportData method. This approach allows you to inject htFix for dimensions and border objects for styling directly into the export engine.

    htFix: Applied to the row object to set a fixed height in pixels.
    border: Applied to the cell object using a CSS-like string syntax (e.g., "1px solid #000000").
    • Coordinate Mapping: Use ri (row index) and ci (column index) to target specific cells or headers.
    Code: [Select]
    eachCell(cell, ci, ri){
    if(ri==2 && ci == 2){
    //debugger
    cell.border = {
    top: "1px dotted #ff0000",
    bottom: "1px solid #ff0000",
    }
    }
    },
    eachRowHead(row, ri){
    row.htFix = 100
    },
    eachRow(row, ri){
    row.htFix = 50
    }

    I was able to apply borders to empty cells and it was exported correctly.
    34
    Help for ParamQuery Pro / pqGrid Excel Export – replace parameter
    « Last post by luckduck on April 20, 2026, 12:55:50 pm »
    I have an additional question regarding the exportData function in pqGrid.

    The `replace` option does not seem to work as expected. I’m not sure if I am using the syntax incorrectly or if there is another issue.

    Here is a sample of my code:

    Code: [Select]
    var blob = await grid.exportData({
        // url: "exportData.do",
        format: format,
        nopqdata: true, // applicable for JSON export
        render: false,
        sheetName: "Example",
        replace: [/<br\/>/g, '\r\n']
    });

    if (typeof blob === "string") {
        blob = new Blob([blob]);
    }

    saveAs(blob, excelNm + "." + format);

    The goal is to replace <br/> tags with line breaks (\r\n) in the exported file, but it does not seem to be applied.

    Could you please confirm whether:
    1. The `replace` option syntax is correct?
    2. There are any limitations or conditions where `replace` does not work?
    3. There is an alternative way to handle line breaks during export?

    Any help would be appreciated.
    35
    Hello,

    I would like to report an issue observed in pqGrid v11 regarding editor behavior.

    When the focus is initially on a cell with editable: false, and then moved (via keyboard navigation) to another cell that is editable but has a null value, the editor becomes active but does not allow text input immediately. The user must click the cell again with the mouse before text input works properly.

    This behavior causes inconvenience, especially when navigating cells using the keyboard and attempting to enter text by pressing Enter.

    You can reproduce this issue using the demo page below:
    https://paramquery.com/pro/demos/edit_multiline

    After navigating to the page, apply the following modifications:

    Code: [Select]
    var colM = [{
            title: "Auto size editor (Enter for new lines)",
            width: 200,
            dataIndx: "ShipAddress1",
            editable: false,
            editModel: {
                saveKey: ''
            }
        },
        {
            title: "Auto size editor (Alt-Enter for new lines)",
            width: 200,
            dataIndx: "ShipAddress2"
        },
        {
            title: "Manually resizable editor",
            width: 200,
            dataIndx: "ShipAddress3",
            editor: {
                type: "textarea",
                attr: "rows=8 cols=58",
                style: "resize:both;",
                appendTo: 'grid'
            },
            editModel: {
                saveKey: ''
            }
        }
    ];

    var dataModel = {
        location: "remote",
        dataType: "JSON",
        method: "GET",
        url: "/content/invoice.json",
        getData: function(response) {
            response.data.forEach(function(rd) {
                rd.ShipAddress1 = rd.ShipAddress2 = rd.ShipAddress3 =
                    rd.ShipAddress + "\n" +
                    rd.ShipCity + "\n" +
                    (rd.ShipRegion || "") + "\n" +
                    rd.ShipPostalCode;
            });
            return response;
        }
    };

    $("div#grid_custom_editing").pqGrid({
        title: "Shipping Orders",
        dataModel: dataModel,
        colModel: colM,
        autoRow: true,
        scrollModel: {
            autoFit: true
        },
        columnTemplate: {
            valign: 'center'
        },
        create: function(evt, ui) {
            this.widget().pqTooltip();
        },
        editModel: {
            clicksToEdit: 1,
            keyUpDown: false
        },
        numberCell: {
            show: false
        },
        resizable: true
    });

    Please refer to the attached screenshots for the test scenario and behavior.

    Thank you for your support.
    36
    Hello,

    I have a question regarding exporting pqGrid data to an Excel file.

    When exporting, I would like to customize:

       - Borders for both header cells and data cells
       - Row height for headers and data

    However, I’m finding it difficult to implement this using only the API documentation. It would be very helpful if you could provide a sample example demonstrating how to apply these styles during export.

    Additionally, in my current implementation, I’ve noticed that when a grid cell value is null, the border is not applied in the exported Excel file. I would appreciate it if you could confirm whether this is expected behavior or if there is a way to handle it properly.

    Thank you in advance for your help.
    37
    stringi is used specifically for local sorting only, moving it to new features board to use this for remote filtering.
    38
    Help for ParamQuery Pro / Re: selectModel bug
    « Last post by paramvir on April 20, 2026, 07:10:48 am »
    It works as documented in the API

    When false/undefined:

    Clicking an unselected row replaces the whole selection
    Clicking a selected row clears all selection
    Ctrl + click needed to add/remove rows from selection


    When true:

    Clicking an unselected row adds it to selection
    Clicking a selected row removes it
    39
    Help for ParamQuery Pro / selectModel bug
    « Last post by jplevene on April 20, 2026, 05:03:59 am »
    Setting selectModel to below:

    Code: [Select]
    selectionModel: { type:"row", mode:"single", column:false, all:false, toggle:false},
    Even though toggle is false, it still toggles.

    My temporary fix for anyone else with the same issue is below:

    Code: [Select]
    rowClick: function(event, ui) {
    var sel = that.grid.pqGrid("SelectRow");
    if( !sel.isSelected({rowIndx:ui.rowIndx }) )
    sel.add({rowIndx:ui.rowIndx});
    },
    40
    Please include the Fixed format too.

    Code: [Select]
        const _isDateFormat = pq.isDateFormat;
        pq.isDateFormat = function (fmt) {
          return fmt == 'Standard' || fmt == 'Fixed' ? false : _isDateFormat.call(this, fmt);
        };

    Updated stackblitz

    https://stackblitz.com/edit/vitejs-vite-kddgijqt?file=index.html,src%2Fmain.jsx,src%2Fpqgrid.jsx

    Pages: 1 2 3 [4] 5 6 ... 10