<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Superdit.com &#187; extcore</title>
	<atom:link href="http://superdit.com/tag/extcore/feed/" rel="self" type="application/rss+xml" />
	<link>http://superdit.com</link>
	<description>blogging, design, tech, and web</description>
	<lastBuildDate>Thu, 19 Jan 2012 07:50:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ExtBox: An Extcore lighbox plugin</title>
		<link>http://superdit.com/2010/07/06/extbox-an-extcore-lighbox-plugin/</link>
		<comments>http://superdit.com/2010/07/06/extbox-an-extcore-lighbox-plugin/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 07:38:27 +0000</pubDate>
		<dc:creator>aditia rahman</dc:creator>
				<category><![CDATA[Extjs]]></category>
		<category><![CDATA[extcore]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://superdit.com/?p=1416</guid>
		<description><![CDATA[Yesterday I googling some tutorial about extcore, sure it is not easy to find example using extcore since the jquery is very popular and maybe some other time I will use jquery too, but the great thing is I found ExtBox, and in this very sort post I want to share it with you. ExtBox<a href="http://superdit.com/2010/07/06/extbox-an-extcore-lighbox-plugin/" class="read-more">Continue Reading</a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday I googling some tutorial about extcore, sure it is not easy to find example using extcore since the jquery is very popular and maybe some other time I will use jquery too, but the great thing is I found ExtBox, and in this very sort post I want to share it with you. ExtBox is an Extcore Plugin to create customizable light box, it is very light weight and the demo provide variety of LightBox themes, just chek it out the <a title="ExtBox: An Extcore Lighbox Plugin" href="http://code.atmaworks.com/extbox/" target="_blank">ExtBox</a></p>
<p style="text-align: center;"><a title="ExtBox: An Extcore Lighbox Plugin" href="http://code.atmaworks.com/extbox/" target="_blank"><img class="alignnone size-full wp-image-1447" title="extbox_pirobox-style" src="http://superdit.com/wp-content/uploads/2010/07/extbox_pirobox-style.png" alt="extbox_pirobox-style" width="500" height="272" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://superdit.com/2010/07/06/extbox-an-extcore-lighbox-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create Spy With ExtCore</title>
		<link>http://superdit.com/2010/07/06/create-spy-with-extcore/</link>
		<comments>http://superdit.com/2010/07/06/create-spy-with-extcore/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 03:10:24 +0000</pubDate>
		<dc:creator>aditia rahman</dc:creator>
				<category><![CDATA[Extjs]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[extcore]]></category>
		<category><![CDATA[spy]]></category>

		<guid isPermaLink="false">http://superdit.com/?p=1140</guid>
		<description><![CDATA[This post is a sort post describing how to create simple spy, if you don&#8217;t know what the spy yet, check the digg spy, that is very cool infographic to displaying updated content from it users, but when this post is created digg using flash technology to pooling data from the server, but this post<a href="http://superdit.com/2010/07/06/create-spy-with-extcore/" class="read-more">Continue Reading</a>]]></description>
			<content:encoded><![CDATA[<p>This post is a sort post describing how to create simple spy, if you don&#8217;t know what the spy yet, check <a title="digg spy" href="http://labs.digg.com/bigspy/" target="_blank">the digg spy</a>, that is very cool infographic to displaying updated content from it users, but when this post is created digg using flash technology to pooling data from the server, but this post using extcore to pooling data from the server, and the code is not really have big different from my <a href="http://superdit.com/2010/06/22/load-content-scroll-using-extcore-and-php/" target="_blank">previus post</a>, I just create single file and include one js file (it&#8217;s the extcore.js file of course), that file i called &#8220;index.php&#8221;, now here we go.<span id="more-1140"></span></p>
<p>Put this PHP code on the top of the file :</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

$data = array(
    0 =&gt; array('post' =&gt; 'Hot News Title 0')
);

for ($i=1; $i&lt;=20; $i++) {
    $tmp_data = array(
        $i =&gt; array('post' =&gt; 'Hot News Title ' . $i)
    );
    $data = array_merge($data, $tmp_data);
}

if (isset($_GET['act'])) {
    if (array_key_exists($_GET['dataindex'], $data)) {
        $i = $_GET['dataindex'];
        $html = '&lt;div class=&quot;data d'.$i.' o'.$i.'&quot;&gt;';
        $html .= $data[$i]['post'].'&lt;/div&gt;';
        echo $html;
    }
    exit;
}

?&gt;
</pre>
<p>The PHP code above is to create temporary data and store it inside array, and the array got a number index, so we can easily to locate the data that we want to collect, the conditional <em>&#8220;if&#8221;</em> statement is to getting data from array and pull it to client, and if the data has reached the maximal limit, the script just response with empty text, and here below the used extcore for create a spy.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
Ext.onReady(function() {

var get_i = 8;
var hideindex = 0;
var task = {
    run: function(){
        Ext.Ajax.request( {
            url: 'index.php?act=getdata&amp;dataindex=' + get_i,
            method: 'post',
            success: function(o) {
                if (o.responseText != '') {
                    Ext.fly('box').insertHtml('afterBegin',
                        o.responseText);
                    Ext.select('.d'+get_i).highlight(&quot;ffff99&quot;, {
                        attr: 'background-color', duration: 1
                    });
                    Ext.select('.d'+hideindex).addClass('none');
                    var pe2 = get_i - 2;
                    var pe3 = get_i - 3;
                    var pe4 = get_i - 4;
                    var pe5 = get_i - 5;
                    var pe6 = get_i - 6;
                    var pe7 = get_i - 7;

                    Ext.select('.d'+pe2).replaceClass('o'+pe2, 'o5');
                    Ext.select('.d'+pe3).replaceClass('o'+pe3, 'o4');
                    Ext.select('.d'+pe4).replaceClass('o'+pe4, 'o3');
                    Ext.select('.d'+pe5).replaceClass('o'+pe5, 'o2');
                    Ext.select('.d'+pe6).replaceClass('o'+pe6, 'o1');
                    Ext.select('.d'+pe7).replaceClass('o'+pe7, 'o0');
                    get_i++;
                    hideindex++;
                } else {
                    var fdiv = '&lt;div class=&quot;data end&quot;&gt;';
                        fdiv = fdiv + 'Data Exhausted, Thanks &amp;nbsp;';
                        fdiv = fdiv + '&lt;a href=&quot;javascript:';
                        fdiv = fdiv + 'window.location.reload()&quot;&gt;';
                        fdiv = fdiv + 'Refresh !&lt;/a&gt;';
                        fdiv = fdiv + '&lt;/div&gt;';
                    Ext.fly('box').insertHtml('afterBegin', fdiv);
                    runner.stop(task);
                }
            }
        });
    },
    interval: 1000 // 1 second
}

var runner = new Ext.util.TaskRunner();

Ext.fly('startLink').on('click', function() {
    var innerLink = document.getElementById('startLink').innerHTML;
    if (innerLink == 'Start') {
        runner.start(task);
        document.getElementById('startLink').innerHTML = 'Stop';
        document.getElementById('text').innerHTML = 'Stop';
    } else {
        runner.stop(task);
        document.getElementById('startLink').innerHTML = 'Start';
        document.getElementById('text').innerHTML = 'Start';
    }
});

});
&lt;/script&gt;
</pre>
<p>The main function to create spy in extcore is <em>TaskRunner</em>,<em> </em>as<em> </em>you can see, the interval is set to one second, which mean every second the client script is accessing the server script (in this code using <em>Ext.Ajax.request</em>) and I made the TaskRunner only will run if users clicked start link. The last thing is the html code put it inside the body tag, well this is for initial state.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;head&quot;&gt;
	To &lt;span id=&quot;text&quot;&gt;Start&lt;/span&gt; Spy, Click &amp;rarr;
	&lt;a href=&quot;javascript:&quot; id=&quot;startLink&quot;&gt;Start&lt;/a&gt;
&lt;/div&gt;
&lt;div id=&quot;box&quot;&gt;
&lt;?php for($i=7; $i&gt;=0; $i--) { ?&gt;
    &lt;div class=&quot;data d&lt;?php echo $i; ?&gt; o&lt;?php echo $i; ?&gt;&quot;&gt;
        &lt;?php echo $data[$i]['post']; ?&gt;
    &lt;/div&gt;
&lt;?php } ?&gt;
&lt;/div&gt;
</pre>
</pre>
<p>And for the styling i'm use css opacity that you can see on the downloadable source code or you can try it online demo.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-1440" title="demo_superdit_com_extcore_spy" src="http://superdit.com/wp-content/uploads/2010/07/demo_superdit_com_extcore_spy.png" alt="demo_superdit_com_extcore_spy" width="460" height="155" /></p>
<p style="text-align: center;"><a href="http://www.box.net/shared/vb8esfj4yt" target="_blank">DOWNLOAD</a> | <a href="http://demo.superdit.com/extcore_spy/" target="_blank">VIEW DEMO</a></p>
]]></content:encoded>
			<wfw:commentRss>http://superdit.com/2010/07/06/create-spy-with-extcore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load Content Scroll Using EXT Core and PHP</title>
		<link>http://superdit.com/2010/06/22/load-content-scroll-using-extcore-and-php/</link>
		<comments>http://superdit.com/2010/06/22/load-content-scroll-using-extcore-and-php/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 04:40:34 +0000</pubDate>
		<dc:creator>aditia rahman</dc:creator>
				<category><![CDATA[Extjs]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[extcore]]></category>

		<guid isPermaLink="false">http://superdit.com/?p=867</guid>
		<description><![CDATA[Extcore is one the Extjs product, but the company name now called sencha, read this why extjs changes their name. If you using full stack Extjs source the Extcore must be included in the source, in this post I want to show how to load content while window scroll from the server using Extcore, this<a href="http://superdit.com/2010/06/22/load-content-scroll-using-extcore-and-php/" class="read-more">Continue Reading</a>]]></description>
			<content:encoded><![CDATA[<p>Extcore is one the Extjs product, but the company name now called <a title="Sencha " href="http://sencha.com" target="_blank">sencha</a>, read this <a title="Ext JS + jQTouch + Raphaël = Sencha" href="http://www.sencha.com/blog/2010/06/14/ext-js-jqtouch-raphael-sencha/" target="_blank">why extjs changes their name</a>. If you using full stack Extjs source the Extcore must be included in the source, in this post I want to show how to load content while window scroll from  the server using Extcore, this feature maybe useful when users want to see more data than visible on the screen maybe like facebook wall, actually this post is similar to another post i found, but using jquery (they are in <a title="Load Data while Scrolling Page Down with jQuery and PHP" href="http://www.9lessons.info/2009/07/load-data-while-scroll-with-jquery-php.html" target="_blank">9lessons.info</a> and <a title="Load Content While Scrolling With jQuery" href="http://www.webresourcesdepot.com/load-content-while-scrolling-with-jquery/" target="_blank">webresourcesdepot.com</a>), in this example i&#8217;m just using one file and the data is hardcoded from array</p>
<p>So lets start, here&#8217;s the php code</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

$data = array(
    0 =&gt; array('post' =&gt; 'Post Number 0')
);

for ($i=1; $i&lt;=50; $i++) {
    $tmp_data = array(
        $i =&gt; array('post' =&gt; 'Post Number ' . $i)
    );
    $data = array_merge($data, $tmp_data);
}

// get next 10 row data,
if (isset($_GET['act'])) {
    $start = ($_GET['page'] * 10) + 1;
    $finish = $start + 10;
    if ($finish &lt;= count($data)) {
        echo '&lt;div class=&quot;data newhead&quot;&gt;Loaded Data &amp;darr;&lt;/div&gt;';
        for ($i=$start; $i&lt;$finish; $i++) {
            echo '&lt;div class=&quot;data&quot;&gt;'.$data[$i]['post'].'&lt;/div&gt;';
        }
    } else {
        echo 'stop';
    }
    exit;
}

?&gt;
</pre>
<p><span id="more-867"></span></p>
<p>In the php code the data created with array format, the conditional <em>&#8220;if&#8221;</em> statement called when the new data need to be loaded (it fetch 10 row data/load), and another conditional <em>&#8220;if&#8221;</em> inside the first statement is to check whether the max row data have been reached, then if max row have been reached there&#8217;s no need to output the data. Now the javascript using Extcore, like usual include the Extcore first</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;extcore/ext-core.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
/* code from :

http://james.padolsey.com/javascript/get-document-height-cross-browser/

*/
function getDocHeight() {
    var D = document;
    return Math.max(
        Math.max(D.body.scrollHeight,
            D.documentElement.scrollHeight),
        Math.max(D.body.offsetHeight,
            D.documentElement.offsetHeight),
        Math.max(D.body.clientHeight,
            D.documentElement.clientHeight)
    );
}
var page = 1;
var onLoad = false;
Ext.onReady(function() {
    Ext.fly(window).on(&quot;scroll&quot;, function() {
        var scrollY;
        var winHeight;
        var docHeight;
        if (!Ext.isIE) {
            scrollY = Ext.fly(window).dom.scrollY;
            winHeight = Ext.fly(window).dom.innerHeight;
        } else {
            scrollY = document.documentElement.clientHeight;
            winHeight = document.documentElement.scrollTop;
        }
        docHeight = getDocHeight();
        if (docHeight &lt;= scrollY + winHeight) {

            Ext.Ajax.on('beforerequest', function(){
                Ext.fly('loading').setVisible(true);
                onLoad = true;
            });
            Ext.Ajax.on('requestcomplete', function() {
                Ext.fly('loading').setVisible(false);
                onLoad = false;
            });

            if (!onLoad) {
                Ext.Ajax.request({
                    url: 'main.php?act=getData&amp;page='+page,
                    method: 'post',
                    success: function(o) {
                        if (o.responseText != 'stop') {
                            Ext.fly('boxdata').insertHtml('beforeEnd', o.responseText);
                            page = page + 1;
                        } else {
                            html = '&lt;div class=&quot;data newhead&quot;&gt;No More Data !&lt;/div&gt;';
                            Ext.fly('boxdata').insertHtml('beforeEnd', html);
                        }
                    }
                });
            }
        }
        return false;
    });
});
&lt;/script&gt;
</pre>
<p>The first function in code above is to get the value of document height thanks to <a title="James Padolsey" href="http://james.padolsey.com/" target="_blank">james.padolsey.com</a> for this function cause the function to get this value is difference in IE, Opera, but Firefox and Webkit browser is almost the same. In Extcore I didn&#8217;t find the function to get this value, so also for the window height and window scroll height, maybe this is why jquery better than Extcore (don&#8217;t compare jquery with the full stack Extjs, this is absolutely different). So Extcore function that I use is to trigger event, ajax request and append new html element. Now this is the CSS code to make it a bit pretty</p>
<pre class="brush: css; title: ; notranslate">
&lt;style type=&quot;text/css&quot;&gt;
    * { font-size: 24px; }

    div {
        padding: 10px;
        margin-bottom: 20px;
        border: 1px solid #000;
    }

    .head {
        padding: 10px;
        background: #333;
        color: #fff;
    }
    .head a {
        color: #ddd;
    }
    .data {
        background: #f3f3f3;
    }
    .newhead {
        background: #d3d3d3;
    }
    #loading {
        display: none;
        background: #fff;
        border: none;
        font-size: 62px;
    }
&lt;/style&gt;
</pre>
<p>And the last is the html code</p>
<pre class="brush: xml; title: ; notranslate">
&lt;body&gt;
    &lt;div class=&quot;head&quot;&gt;
        This is example for load scroll using Extcore
    &lt;/div&gt;
    &lt;div id=&quot;boxdata&quot;&gt;
        &lt;?php for($i=0; $i&lt;=10; $i++) { ?&gt;
        &lt;div class=&quot;data&quot;&gt;
            &lt;?php echo $data[$i]['post']; ?&gt;
        &lt;/div&gt;
        &lt;?php } ?&gt;
    &lt;/div&gt;
    &lt;div id=&quot;loading&quot;&gt;
        &lt;img src=&quot;img/27.gif&quot; alt=&quot;loading&quot;/&gt;
        &amp;nbsp;
        Please Wait...
    &lt;/div&gt;
&lt;/body
</pre>
<p>Yup that&#8217;s all hope this useful for you and you can download all the code example or view the live demo</p>
<p><a title="Load Scroll Using Extcore Source Download" href="http://www.box.net/shared/dlt14j8e02" target="_blank">DOWNLOAD SOURCE</a></p>
<p><a title="Load Scroll Using Extcore Demo" href="http://demo.superdit.com/extcore_load_scroll/" target="_blank">VIEW DEMO</a></p>
<pre>﻿﻿﻿﻿﻿</pre>
]]></content:encoded>
			<wfw:commentRss>http://superdit.com/2010/06/22/load-content-scroll-using-extcore-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

