Monday, August 19, 2013

pointcuts before and after an ajax call in dojo?

I've been struggling in searching for proper pointcuts for dojo ajax calls.
The problem is that I'm using JsonRest with DGrid and pagination plugin -- actually it's not a "problem" because I chose to do so in order to shorten the development cycle for core frontend functionality. However, this combination doesn't offer the solution to several minor issues. For example, I want to show a loading picture, instead of just a loading message.
I decided to use aspect advice functions, which is a great piece of functionality available after dojo 1.7. It's not so easy to find the pointcuts to define advices. Reasons are here: http://dojo-toolkit.33424.n3.nabble.com/dojo-aspect-before-function-not-firing-td3985714.html#a3998683 )

In the end, I got some workaround to advise on _create method of dojo/request/xhr. But as I mentioned it's not a nice solution. Hopefully sitepen guru could expose some pointcuts in future releases.

No comments: