0

I am trying to get the jQuery plugin "DataTables" working in XPINC but have not found a way for that.

These resources are included into the applications "Web-Content"-Folder:

<xp:script src="jquery/jquery.min.js" type="text/javascript" clientSide="true"/>
<xp:script src="jquery/plugins/DataTables/dataTables.js" type="text/javascript" clientSide="true"/>

When viewing in a browser everything works fine.

But the initialisation of the DataTable-plugin is not passing in XPINC. If I manually try to find out if $.fn.dataTables exists, the browsers shows me an [object] while XPINC returns "undefined".

Has anyone else tried this plugin and finally got it working for browser and XPINC?

  • 1
    Try to leave out the /*.nsf part of your link as the context root is always the database itself, e.g. "jquery/..." – Oliver Busse May 28 '13 at 19:42
  • I edited the lines with the script and entered the source as it is in the XPage. Once again. This is working in every browser but *not* in the Notes Client. Is there anyone else who need to have jQuery plugins working on both sides (browser/Notes Client) – Pantelis Botsas May 29 '13 at 07:06
  • http://stackoverflow.com/questions/9635494/server-independent-reference-in-an-xpages-theme – Frantisek Kossuth May 29 '13 at 10:42
  • Finally I got this thing working by following the instructions given [here](http://hasselba.ch/blog/?p=1216). In order to have the jQuery plugin working you **need** to include the script and css files as a part of the document header (not as plain resources).# – Pantelis Botsas May 29 '13 at 12:21
  • Nice! Please, rephrase your solution as Answer. – Frantisek Kossuth May 29 '13 at 15:27
  • @PantelisBotsas I second Frantisek, answer your own question in the answer block below including the sample code. Closes the question, can be upvoted and adds to your repudiation :-) – stwissel May 30 '13 at 01:45

1 Answers1

1

Finally I got this thing working by following the instructions given here. In order to have the jQuery plugin working you need to include the script and css files as a part of the document header (not as plain resources).