Topic: loading display per function

in version 0.2 i used an wraparound to determine whether i want to show the loading label (e.g. functions which has to collect a large amount of data)

i was wondering if that could be added in 0.5 (or 0.6)

like something below

$xajax->register(XAJAX_FUNCTION, new xajaxUserFunction(functionName, file,loader(show=false,label='')));

$xajax->loadingObject = object (e.g. Div which contains a loading gif)
$xajax->loadingLabel = object (to show the label when show is set true)

with this extra setting it should be easier to determine to show the loader..

i hope more people like the kind of loading integration in xajax (or maybe i've looking with my eyes closed?)


Symbiot


ps: below is my wrap-around for version 0.2.4:

my javascript wrap-around (it uses an function te determine the center

xajax.realCall = xajax.call; 
xajax.call = function(sFunction, aArgs, sRequestType) 
    {
        if (aArgs[0] != '') 
            { 
                var arrayPageSize = getPageSize();    // a function to get pageSizes
                if(typeof(window.pageYOffset)=='number') { pageY=window.pageYOffset;  } else { pageY=document.documentElement.scrollTop; }
                with (this.$('dataLoader'))
                    {
                        style.position = "absolute";
                        style.top = (pageY +(arrayPageSize[3]/2) +10)+'px';
                        style.left = (((arrayPageSize[2] / 2)+document.body.scrollLeft)-100)+'px';
                        style.display = 'block';
                    }
                this.$('loadinglabel').innerHTML = '<b>loading: </b> ' + aArgs[0];
            }
        return this.realCall(sFunction, aArgs, sRequestType);
    }

xajax.realProcessResponse = xajax.processResponse; 
xajax.processResponse = function(xml) 
    { 
        this.$('dataLoader').style.display = 'none'; return this.realProcessResponse(xml);
    }

in each function an extra parameter (the first) is needed in order to trigger the loader to show when not ''
example:

function loadAmountOfData($loadingLabel='')
    {
    }

by calling it like this:

xajax_loadAmountOfData('');

it won't show the loader
but when calling it like this:

xajax_loadAmountOfData('large amount of data');

it does show (i know its obvious, pure to illustrate my idea)

[xajax 0.5 RC 2 Minimal]
Sometimes, the sound of goodby is louder than any drumbeat

Re: loading display per function

Why are u using this hack instead of the integrated loading callback functions?

Re: loading display per function

the hack i used was in version 0.2.4, in version 0.5 i use the integrated callback function, but i still think it is a good idea to integrate the loading status per function (or am i the only one?)

[xajax 0.5 RC 2 Minimal]
Sometimes, the sound of goodby is louder than any drumbeat

Re: loading display per function

You can define a loading callback per function. Use the search function tongue

5 (edited by symbiot 2008-11-25 4:24:08 PM)

Re: loading display per function

haha, well, it

[xajax 0.5 RC 2 Minimal]
Sometimes, the sound of goodby is louder than any drumbeat