Use of Jquery in framework.js

Post here questions and problems related to oXygen frameworks/document types.
pramanikhimangshu
Posts: 16

Use of Jquery in framework.js

Tue Jan 30, 2018 8:38 am

Hello,

I need to create a dialog-box with resize-able html table in oXygen Web Author.
To do this what shall I do, If I can use jquery then how shall I include the jquery js file in framework.js?
Or there is any better alternative to do this, kindly guide me.

Thank you.
Regards,
Himangshu.
Gabriel Titerlea
Posts: 34

Re: Use of Jquery in framework.js

Tue Jan 30, 2018 1:12 pm

Hello,

I need to create a dialog-box with resize-able html table

If you want to resize the columns and rows of the table the implementation is up to you. If you want to resize the entire table, you can make the table's height and width be 100% and make the dialog in which the table resides re-sizable.

You can create a re-sizable dialog like this [1][2]:

Code: Select all

var dialog = workspace.createDialog()
dialog.setResizable(true);
dialog.setContentPreferredSize(WIDTH, HEIGHT);
dialog.getElement().appendChild(YOUR_RESIZABLE_TABLE_ELEMENT);
dialog.show();

Regarding the use of libaries like JQuery. You can prepend the entire JQuery library at the start of the framework.js file.

Best,
Gabriel

[1] https://www.oxygenxml.com/maven/com/oxy ... eateDialog
[2] https://www.oxygenxml.com/maven/com/oxy ... ialog.html
pramanikhimangshu
Posts: 16

Re: Use of Jquery in framework.js

Tue Jan 30, 2018 3:41 pm

Hi Gabriel Titerlea,

Thank you for the reply.
I want to resize the html table column size according to user preference inside the dialog box and not the full dialog.
So if I want to include jQuery or other plugin js files to use in framework.js file, so that I can customize individual html content.

Code: Select all

var imported = document.createElement('script');
imported.src = sync.ext.Registry.extensionURL + "external.js";
document.head.appendChild(imported);


I used it like this in the framework.js. It worked!
Thanks again.
Regards,
Himangshu.

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest