Page 1 of 1

Use of Jquery in framework.js

Posted: Tue Jan 30, 2018 8:38 am
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.

Re: Use of Jquery in framework.js

Posted: Tue Jan 30, 2018 1:12 pm
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

Re: Use of Jquery in framework.js

Posted: Tue Jan 30, 2018 3:41 pm
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.