Creating extension from jQuery plugin

Answered
0
0

I found a jQuery plugin that I would like to create wise extension for

https://github.com/ka215/jquery.timeline

As there are no clear instructions here is what I have done so far:

  • Created separate Wisej Web Control Project
  • Copied jQuery Plugin redistributable files to JavaScript folder
  • Created startup.js in Javascript folder for initialising the control
  • updated control.cs to include BuildInitScript

The issue I can see is that the way it is set up in itializatioon it requires

var tlElem = $(‘#my-timeline’) – so it requires referense to <div> where control is placed,

and they is is initialised in code with:tlElem.Timeline(window.tlOpts);

How can I rewrite this, so that it is self initialised?

 

I have included TestHTML.html in the project where native jQuery component is initialised and works correctly.

 

Attachment
  • You must to post comments
Best Answer
0
0

You might find this helpful: https://wisej.com/blog/integration1/

In startup.js, you do this:

var id = this.getId() + "_timeline";
this.Timeline = this.widget = $("#" + id);
this.Timeline.Timeline(window.tlOpts);

But you need to do this instead:
$(this.container).Timeline(window.tlOpts);

Also, something to keep in mind as you work on this: You’ll need to clear the cache every time you change the code in the startup.js file. Otherwise, it will use the old code.

  • You must to post comments
0
0

Here is a sample:

  • You must to post comments
0
0

I managed to get display working and timeline control is now displayed in wisej control.

I am now struggling how to expose: startDatetimeendDatetime, sidebar.list, rows and eventData. they are all set in window.tlOpts and I would like to define them as control properties.

  • You must to post comments
0
0

I have updated code so that I can see that javascript works (references were missing as well as jQuery.min.js)

Now I can see that code from startup.js is executing and background is changed from code.

but still timeline control is not showing up.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.