ogobrecht / apex-plugin-dhtmlx-gantt

Oracle APEX Region Type Plugin: HTML5 Gantt chart based on a dhtmlx.com library
https://apex.oracle.com/pls/apex/f?p=116612:1
Other
21 stars 4 forks source link

Issue with DHTMLX lib 8.0 - Printing Service #36

Open jzzh opened 9 months ago

jzzh commented 9 months ago

Hi Ottmar

After upgrading to version 8.0.x there were no errors and the Gantt rendering is still working.

There is just the issue with the changes for the printing service.

Printing in 8.0 now works with an extension and the PDF generation is only creating empty files for me.

gantt.plugins({ export_api: true }); https://docs.dhtmlx.com/gantt/migrating.html

I tried this workaround by hardcoding the setting in the Plugin code, but it did not have an effect.

-- prepare code for extensions 
v_extensions := APEX_UTIL.STRING_TO_TABLE(p_region.attribute_17);
    for i in 1..v_extensions.count loop
        v_extensions_js := v_extensions_js || 'gantt.plugins({ ' || v_extensions(i) || ': true });';
    end loop;
-- Hardcoded Workaround
v_extensions_js := v_extensions_js || 'gantt.plugins({ export_api: true });';

Would you know a workaround until you find the time to upgrade the plugin to 8.0 ?

Thanks, Jochen

jzzh commented 9 months ago

Also relevant for this problem is that Google Chrome will be blocking cross-site cookies as this was used in the API call to DHTMLX before. The call to https://export.dhtmlx.com/gantt/api.js will not be working then anymore..

Warning in Chrome console: Reading cookie in cross-site context will be blocked in future Chrome versions Cookies with the SameSite=None; Secure and not Partitioned attributes that operate in cross-site contexts are third-party cookies. In future Chrome versions, reading third-party cookies will be blocked. This behavior protects user data from cross-site tracking. Please refer to the article linked to learn more about preparing your site to avoid potential breakage. 3 cookies Name Domain & Path _ym_uid .dhtmlx.com/ _ym_d .dhtmlx.com/ _ym_isad .dhtmlx.com/

https://developers.google.com/privacy-sandbox/3pcd#report-issues

jzzh commented 9 months ago

My bad, printing works with 8.0 !

It was not a problem with the new version, but with my custom template scales. The only thing you have to do is calling:

gantt.plugins({ export_api: true });

instead of apex.jQuery.getScript("https://export.dhtmlx.com/gantt/api.js");

in "After Init JS Code" attribute.

ogobrecht commented 9 months ago

Hi Jochen,

thanks for all your input and testing. This helps to cut down the needed time for an update.

Best regards Ottmar