how to create custom endpoints and multiple connection in jsplumb - jsplumb

Can we create custom endpoints in jsplumb, apart from usual dot, rectangle etc i want to use rectangle outside my div as shown below
also how can i use this for multiple connections as show below.
example code will help me more.

I don't know of a way to do it in the JsPlumb library directly.
The way I solved this issue was to draw html or svg over the actual jsPlumb endpoint.
There is a caveat in doing it this way though. You can not have dynamic endpoints you can only use the fixed endpoints. I think you could setup some javascript that matches the location of the endpoint. But that just seems messy.

When you are defining the endpoint, check if you're setting the maxConnections parameter.
For example, when you set maxConnections : -1, it will enable the endpoint to accept infinite number of connections

Related

Umbraco 7 - Alternative URLs

I am using Umbraco 7 and I need to achieve something which I am not entirely sure of the best way to approach it.
Basically I have vacancies on a website that have URLs currently such as this:
/vacancies/a/almighty-school/live/first-year-teacher/
What I want is for the URL to NOT show the /a and /live part (which are needed for structuring in the administration area), so basically the above URL would be:
/vacancies/almighty-school/first-year-teacher
I am not entirely sure of the best way of doing this, I know about URL Rewriting but am not sure if that could do this and if it could I really am not that clued up on the regular expressions needed to create it.
Any ideas anyone??
Add a property called umbracoUrlAlias, type Textstring, to your document type. Set the value to be "/vacancies/almighty-school/first-year-teacher".
This is a "magic string" that will then allow the document to be accessed via an alternate URL.
You could also set up a ContentService.Saving event to automatically set the value of this on the given node according to some preset rules.
I think the best way to tackle this is to create your own Segment Provider:
When the URL is build up, umbraco will convert every node into a segment. Each published Content has a url segment.
The documentation for manipulating these segments can be found here: http://our.umbraco.org/documentation/Reference/Request-Pipeline/outbound-pipeline

How to override Dojo's xhrGet and xhrPost?

We are extensively using Dojo's xhrGet and xhrPost in our application. This has been used across multiple JavaScript files. Now we need a uniform way in which we handle the exceptions that are returned from the server in case of an AJAX call. We don't want to handle this in all places where we are using Dojo's xhrGet or xhrPost. Is it possible to do that without disturbing any of the existing code? For example, when some exception is sent from the server as part of the ajax response, I need to display some message in a consistent way across the application.
Could you please suggest me a solution for this? Kindly let me know if any more information is required.
Use IO Pipeline Topics as I described in Generic Loading Icon in Dojo and you won't have to change your code at all.
did you look at the dojo/aspect or dojo/on ? You can define functions that get executed after a function was called (or before) with aspect.
Take a look at that:
http://dojotoolkit.org/reference-guide/1.8/dojo/aspect.html#dojo-aspect-after
Why dont you create a custom xhrArgs class using dojo/declare that has the same error function for all his children ?
http://dojotoolkit.org/reference-guide/1.8/dojo/_base/declare.html#dojo-base-declare
Lucian

filtering kml in a static map

i'm developing a desktop application, not web.
The software environment is Windows and VB10.
In my user interface I have a browser where I want to show a map, issuing an address like http://maps.google.com/maps?q= and then I indicate a URL where I have put a KML file with my data.
The problem is: is it possible to filter the data in the KML file in order to show only a subset of them ?
Basically you have two options:
Pass parameters to a service which generates your filtered KML on the fly.
Do it in JavaScript in your browser interface.
Based on your question, I am going to assume option one is out. For option two there are tons of examples on the web, but basically you need to parse the KML yourself and write JavaScript code to handle it however it needs to be done to achieve your filtering, you cannot pass the KML URL to google maps directly and achieve any of this behaviour.
Possibly useful example: http://www.gpsvisualizer.com/examples/google_folders.html
UPDATE
Based on conversation in the comments:
The only other thing I can think of is to create your own map page with the JavaScript to do what you want on it (like http://gpsvisualizer.com/examples/google_folders.html linked above) and then embedding it in your app instead of the google map. Essentially encapsulating the features you want. So instead of maps.google.com/maps?q= in your app you have myMapURL.com/MyMap?querystring which is your google maps wrapper with the desired filtering. Otherwise I think you are out of luck based on your current setup.

Ajax results filtering and URL parameters

I am building a results filtering page using AJAX requests. I would like to reflect the filters in the URL. For example: for price_from I want to add ?price_from=VAL to the URL.
I have a backend that is capable of rendering the page with URL parameters.
After some googling I would a Backbone.router solution which has a hash fallback for the IE that does not support HTML5 history API.
I have a problem with setting a good philosophy of routes. I have a set of filtering parameters (price_from, price_to, color, ...) and I would like to attach each parameter to one route.
Is that possible to chain the routes to match for example: ?price_from=0&price_to=1&color=red? (the item order can change)
It means: call all the routes at the same time and keep the ie backwards compatibility?
Your best bet would be to have a query portion of the URL rather than using GET parameters to denote the search criteria. For example:
Push state: /search/query/price_from=0&price_to=1&color=red
Hash based: #search/query/price_from=0&price_to=1&color=red
Your backend would of course need to change a bit to be able to parse the new URL structure.

Fillter/Sort the datas in ArrayStore ExtJS

Using a Grid component, we wish to sort and filter rows using hidden values.
Sort and filters are working fine with visible values,
but we have now changed the format used for display,
and we wish to use previous values for sort and filtering.
We are using the ArrayStore, without any proxy.
We are looking for a solution on the client side, in JavaScript only
(no round trip to the server).
http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.ArrayStore
suggest look at methods sort() and filter(), others also can be usefull

Resources