jQWidgets Forums

jQuery UI Widgets Forums Grid exportview and columnchooser

This topic contains 3 replies, has 2 voices, and was last updated by  admin 4 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • exportview and columnchooser #112423

    DeployDuck
    Participant

    Hello,
    I want to achieve that my users can reduce / select the columns of the grid using the new “columnchooser” and then only export these columns.
    To achieve this, I have used the script suggested by Hristo:

    var columns = $("#jqxgrid").jqxGrid("columns");
      for (var column of columns.records) {
        if (column.hidden) {
        	$("#jqxgrid").jqxGrid("setcolumnproperty", column.datafield, "exportable", false);
        } else {
        	$("#jqxgrid").jqxGrid("setcolumnproperty", column.datafield, "exportable", true);
        }
      }

    This marks the columns, that should not be exported and so works perfectly when using the old “exportdata” function of the grid:
    $("#MyGridID").jqxGrid('exportdata', 'csv', "ExportFileNameExample", true, null, true, "https://example.com/path/to/dataexport.php");

    But I want to use the new “exportview” function of the grid to export – amongst other things – xlsx data.
    So I use instead:
    $("#MyGridID").jqxGrid('exportview', 'csv', "ExportFileNameExample", true, null, true);

    The problem is, that “exportview” does not respond to the columns property “exportable” and so all columns will be exported – regardless what is set through “columnchooser”.

    I can’t find any entry about “exportview” in the api documentation.
    Is there any other way to achieve my goal? Any suggestions?

    With regards
    DeployDuck

    exportview and columnchooser #112667

    DeployDuck
    Participant

    Hello, why am I paying for support?
    One month ago – still no answer – a shame.

    exportview and columnchooser #112669

    DeployDuck
    Participant

    discussion closed.

    exportview and columnchooser #112670

    admin
    Keymaster

    Hi DeployDuck,

    This is a Community Forum, where answers should be expected only from other Forum users.

    If you are a customer, the support questions should be sent to support@jqwidgets.com.

    Regarding this questions:

    In the current version exportview takes into account the “exportable” value. However, the Column Chooser only handles the Columns Visibility. When a column is hidden, it still can be exportable. It will not be exported only when “exportable” is set to false.

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

You must be logged in to reply to this topic.