<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[xajax Forums - Several loaders images as callbacks]]></title>
	<link rel="self" href="http://community.xajaxproject.org/feed/atom/topic/8299/"/>
	<updated>2010-03-26T15:39:21Z</updated>
	<generator>PunBB</generator>
	<id>http://community.xajaxproject.org/topic/8299/several-loaders-images-as-callbacks/</id>
		<entry>
			<title type="html"><![CDATA[Re: Several loaders images as callbacks]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/post/29316/#p29316"/>
			<content type="html"><![CDATA[Hi,

That looks as good as any...

Ed]]></content>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/693/</uri>
			</author>
			<updated>2010-03-26T15:39:21Z</updated>
			<id>http://community.xajaxproject.org/post/29316/#p29316</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Several loaders images as callbacks]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/post/29315/#p29315"/>
			<content type="html"><![CDATA[For all who try this or want to display the loading-message not at every xajax-Request:

[code]
  <script>  
    function lsc(bo)
    {
      if (bo == "yes") {      
        xajax.callback.global.onRequest = function() {xajax.$('loading').style.display = 'block';}
        xajax.callback.global.beforeResponseProcessing = function() {xajax.$('loading').style.display='none';}
      } else {
        xajax.callback.global.onRequest = function() {}
        xajax.callback.global.beforeResponseProcessing = function() {}          
      }
    }
  </script>
[/code]

[code]
<a href="#" onClick="lsc('no');xajax_abc();">No Loading Screen</a>
[/code]

[code]
<a href="#" onClick="lsc('yes');xajax_xyz();">Show Loading Screen</a>
[/code]

Or is there another method to do this?

Thank you...
dsta]]></content>
			<author>
				<name><![CDATA[dsta]]></name>
				<uri>http://community.xajaxproject.org/user/4378/</uri>
			</author>
			<updated>2010-03-26T09:18:06Z</updated>
			<id>http://community.xajaxproject.org/post/29315/#p29315</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Several loaders images as callbacks]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/post/29129/#p29129"/>
			<content type="html"><![CDATA[Great idea, thanx Ed!]]></content>
			<author>
				<name><![CDATA[piotrycjan]]></name>
				<uri>http://community.xajaxproject.org/user/4316/</uri>
			</author>
			<updated>2010-02-08T22:12:09Z</updated>
			<id>http://community.xajaxproject.org/post/29129/#p29129</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Several loaders images as callbacks]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/post/29128/#p29128"/>
			<content type="html"><![CDATA[You can alter the callbacks at every call...

[code]
<script>
  function setupProcessing(divid)
  {
    xajax.callback.global.onRequest = function() {xajax.$(divid).style.display='block';}
    xajax.callback.global.beforeResponseProcessing = function()
       {xajax.$(divid).style.display='none';}
  }
</script>
...
<html>
...
<input ... onclick="setupProcessing('div1');xajax_myFunc1(...);"/>
<input ... onclick="setupProcessing('div2');xajax_myFunc2(...);"/>
...
</html>
[/code]

This is from a sample loading message example but you could alter it to hide all divs that are not to be shown and show the passed div id. Might only need the onrequest function.

Ed]]></content>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/693/</uri>
			</author>
			<updated>2010-02-08T17:53:50Z</updated>
			<id>http://community.xajaxproject.org/post/29128/#p29128</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Several loaders images as callbacks]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/post/29127/#p29127"/>
			<content type="html"><![CDATA[I've already try this solution. It works but only for greater then first xajax function call. First call displays old style - it's logical. It'll be better if I could assign different divs for each functions...]]></content>
			<author>
				<name><![CDATA[piotrycjan]]></name>
				<uri>http://community.xajaxproject.org/user/4316/</uri>
			</author>
			<updated>2010-02-08T16:46:08Z</updated>
			<id>http://community.xajaxproject.org/post/29127/#p29127</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Several loaders images as callbacks]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/post/29126/#p29126"/>
			<content type="html"><![CDATA[Hi,

You can avoid using the callbacks altogether by assigning the div stles using the response assign() function.

See here:

[url]http://community.xajaxproject.org/topic/7903/trying-to-edit-the-style-propiety/[/url]

Ed]]></content>
			<author>
				<name><![CDATA[edrobinson]]></name>
				<uri>http://community.xajaxproject.org/user/693/</uri>
			</author>
			<updated>2010-02-08T14:06:52Z</updated>
			<id>http://community.xajaxproject.org/post/29126/#p29126</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Several loaders images as callbacks]]></title>
			<link rel="alternate" href="http://community.xajaxproject.org/post/29122/#p29122"/>
			<content type="html"><![CDATA[Hi,

Can you tell me how to make different callbacks from several HTML's divs? 

A.E. : I've got two different xajax functions and I want do display different divs when they're processed.

PHP/XAJAX
[code]
function cat () {
$objResponse = new xajaxResponse();
...
return $objResponse;
}
function dog () {
$objResponse = new xajaxResponse();
...
return $objResponse;
}
[/code]

HTML
[code]
<div id='loader_cat' />
<div id='loader_dog' />
[/code]

Basically for one div I'm using xajax.callback.global.onRequest and xajax.callback.global.beforeResponseProcessing, but I don't have an idea how to use it for diffrent divs and functions.

Please help :)]]></content>
			<author>
				<name><![CDATA[piotrycjan]]></name>
				<uri>http://community.xajaxproject.org/user/4316/</uri>
			</author>
			<updated>2010-02-06T20:48:25Z</updated>
			<id>http://community.xajaxproject.org/post/29122/#p29122</id>
		</entry>
</feed>
