Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem with hidden listgrid field on Canvas.showPrintPreview

    Hi!

    My application has a listgrid whose first column is a checkbox, where users can select records for printing (see my_app.jpg).

    When users click the print button, I have the following code to hide this column and print the grid:

    Code:
    btnPrint.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        myGrid.hideField("checkboxField");
        Canvas.showPrintPreview(myGrid);
        myGrid.showField("checkboxField");
      }
    });
    The problem is that the print preview window just hides the checkbox column for the first 100 records, as you can see in hidden_field_print_preview.jpg. After that the checkbox is still visible in the preview.

    My grid has the following properties:
    Code:
    myGrid.setShowAllRecords(false);
    myGrid.setDataFetchMode(FetchMode.PAGED);
    myGrid.setDataPageSize(100);
    We can see that the grid is paged by exactly 100 records. But the print button is only visible when mygrid.getResultSet().allRowsCached() is true

    Is that a bug or am I doing something wrong? Do any of you have a better idea about how to hide a field for printing?

    By the way, I'm using latest smartgwt (2.4).

    Best regards,
    Matheus
    Attached Files
Working...
X