Use of Jquery in framework.js

Post here questions and problems related to oXygen frameworks/document types.
pramanikhimangshu
Posts: 17
Joined: Fri Dec 29, 2017 11:16 am

Use of Jquery in framework.js

Post by pramanikhimangshu »

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
Site Admin
Posts: 95
Joined: Thu Jun 09, 2016 2:01 pm

Re: Use of Jquery in framework.js

Post by Gabriel Titerlea »

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: 17
Joined: Fri Dec 29, 2017 11:16 am

Re: Use of Jquery in framework.js

Post by pramanikhimangshu »

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.
Post Reply