jQWidgets Forums

jQuery UI Widgets Forums Grid PDF Export error or bug?

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • PDF Export error or bug? #87093

    mr_putersmit
    Participant

    Hi
    I have a strange problem which I shall try to fully explain. I am using jQWidgets v4.2.1 and am experiencing a strange problem with pdf export which I am not sure if it is an error or a bug. Here is the scenario.

    Link1 > Page1
    Link2 > Page2
    Link3 > Page3

    Page1 has the following export code.

    $("#pdfExport").click(function () {
                    $("#jqxgrid").jqxGrid('exportdata', 'pdf', 'Box Retrieval Report');
                });

    Page2

    $("#pdfExport").click(function () {
                    $("#jqxgrid").jqxGrid('exportdata', 'pdf', 'Box Return Report');
                });

    Page3

    $("#pdfExport").click(function () {
                    $("#jqxgrid").jqxGrid('exportdata', 'pdf', 'Box Destruction Report');
                });

    Now the weird bit. When I first load the grid, and click say page1, when I click on page1 export to pdf, it opens fine. However, when I click page2 and click the export pdf button, not only does it open the ‘Box Return Report’, it also opens the ‘Box Retrieval Report’ which is the link for page 1. This keps escalating so if I click page 3 export pdf button, it also opens the previous exports so I now have 3 pdf reports opening. As I say, I am not sure if it is an error from my end, but firebug is reporting no errors.

    All libraries are loaded and appear to be working. I hope that I have explained the problem clearly and someone can shed some light as to why this is happening. Excel and html are fine. Just pdf.

    Many thanks

    PDF Export error or bug? #87097

    Peter Stoev
    Keymaster

    Hi mr_putersmit,

    jqxGrid exports the data loaded in the Grid. From this code, I expect to see 3 identical PDF files with different names and I also expect the same code to be executed 3 times, because you bind to the same event of the same button 3 times.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    PDF Export error or bug? #87101

    mr_putersmit
    Participant

    Hi
    Thanks for reply Peter. However, I am confused as excel does not experience this behavior. Can you do example as to how this pdf export should work as I am slightly confused by your answer. Many thanks

    PDF Export error or bug? #87115

    admin
    Keymaster

    Hi mr_putersmit,

    It works exactly the same way as it uses the same function. In the posted code, you bound 3 times to a button’s click event so you will have the export function executed 3 times.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

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

You must be logged in to reply to this topic.