<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Recent Posts in 'binding? scoping?' | Pragmatic Forums</title>
    <link>http://forums.pragprog.com/forums/45/topics/357</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <description></description>
    <item>
      <title>binding? scoping? posted by Christophe Porteneuve @ Tue, 08 Apr 2008 20:34:45 -0000</title>
      <description>&lt;p&gt;That&amp;#8217;s because you used responseText instead of responseJSON, tss tss&#8230;&lt;/p&gt;</description>
      <pubDate>Tue, 08 Apr 2008 20:34:45 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:45:357:2562</guid>
      <author>Christophe Porteneuve</author>
      <link>http://forums.pragprog.com/forums/45/topics/357</link>
    </item>
    <item>
      <title>binding? scoping? posted by St&#233;phane Boisvert @ Tue, 08 Apr 2008 16:25:36 -0000</title>
      <description>&lt;p&gt;Answered it myself the offending line is this:&lt;br /&gt;var GroupNames = arg.responseText.pluck(&amp;#8216;FieldGroupID&amp;#8217;);&lt;/p&gt;


	&lt;p&gt;For some strange reason I thought since I did a &lt;span class="caps"&gt;JSON&lt;/span&gt; response header that it would be automatically into a &lt;span class="caps"&gt;JSON&lt;/span&gt; array. doing an evail before the pluck solved the problem. &lt;br /&gt;Christophe, Is there some easier way to get the json evaluated response?&lt;/p&gt;</description>
      <pubDate>Tue, 08 Apr 2008 16:25:36 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:45:357:2560</guid>
      <author>St&#233;phane Boisvert</author>
      <link>http://forums.pragprog.com/forums/45/topics/357</link>
    </item>
    <item>
      <title>binding? scoping? posted by St&#233;phane Boisvert @ Tue, 08 Apr 2008 03:38:21 -0000</title>
      <description>&lt;pre&gt;
function CreateSortableGroups(){
    var url = 'controller.php?Action=GetGroupsName';
    var myAjax = new Ajax.Request(url,
    {method: 'get', onComplete: function (arg){
        console.log('Foo1');
        var GroupNames = arg.responseText.pluck('FieldGroupID');
        GroupNames.each(function(n){
            console.log('foo2');
              var options = {
                constraint: false, containment: GroupNames,
                dropOnEmpty: true, onUpdate: function(list) {
                    var methodStart = list.down('li') ? 'remove' : 'add';
                      list[methodStart + 'ClassName']('FieldGroupEmpty');
                }
              };
            console.log('foo3');
            console.log(options);
            Sortable.create(n, options);
          })
        }
    }
    );
}
&lt;/pre&gt;&lt;br /&gt;Clarifications: (En Francais sa va etre plus facile bon)&lt;br /&gt;GroupNames deviens un array de ID de element ul&lt;br /&gt;dans le log de firebug foo1 apparait mais foo2, foo3 et la variable option n&amp;#8217;apparaise pas.

	&lt;p&gt;Merci pour ton temps, C&amp;#8217;est vraiment appr&#233;ci&#233;.&lt;/p&gt;</description>
      <pubDate>Tue, 08 Apr 2008 03:38:21 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:45:357:2558</guid>
      <author>St&#233;phane Boisvert</author>
      <link>http://forums.pragprog.com/forums/45/topics/357</link>
    </item>
    <item>
      <title>binding? scoping? posted by Christophe Porteneuve @ Mon, 07 Apr 2008 21:42:04 -0000</title>
      <description>&lt;p&gt;Hey St&#233;phane, could you please (a) repost with proper code formatting, and (b) rephrase what you say after the code? I just can&amp;#8217;t understand your last sentence!  Thanks :-)&lt;/p&gt;</description>
      <pubDate>Mon, 07 Apr 2008 21:42:04 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:45:357:2554</guid>
      <author>Christophe Porteneuve</author>
      <link>http://forums.pragprog.com/forums/45/topics/357</link>
    </item>
    <item>
      <title>binding? scoping? posted by St&#233;phane Boisvert @ Mon, 07 Apr 2008 16:51:40 -0000</title>
      <description>&lt;p&gt;Bonjour,&lt;/p&gt;


	&lt;p&gt;I was wondering if you could help me out with a little problem. I am doing something based on the dragdrop 5 example.&lt;/p&gt;


&lt;code&gt;
function CreateSortableGroups(){
    var url = 'controller.php?Action=GetGroupsName';
    var myAjax = new Ajax.Request(url,
    {method: 'get', onComplete: function (arg){
        console.log('Foo1');
        var GroupNames = arg.responseText.pluck('FieldGroupID');
        GroupNames.each(function(n){
            console.log('foo2');
              var options = {
                constraint: false, containment: GroupNames,
                dropOnEmpty: true, onUpdate: function(list) {
                    var methodStart = list.down('li') ? 'remove' : 'add';
                      list[methodStart + 'ClassName']('FieldGroupEmpty');
                }
              };
                console.log('foo3');
                console.log(options);
            Sortable.create(n, options);
          })
        }
    }
    );
}
&lt;/code&gt;

	&lt;p&gt;Now strangely the Groups (a &lt;span class="caps"&gt;JSON&lt;/span&gt; array of IDs already Created that gets returned) get created as sortables but not with the options and foo2 and foo3 and options are not sent to the console&amp;#8230; I&amp;lt;m foolish be very something to bound this i is sure&gt;&amp;lt;m of aware not jsut&gt;&lt;/p&gt;


	&lt;p&gt;thanks&lt;/p&gt;</description>
      <pubDate>Mon, 07 Apr 2008 16:51:40 -0000</pubDate>
      <guid isPermaLink="false">forums.pragprog.com:45:357:2553</guid>
      <author>St&#233;phane Boisvert</author>
      <link>http://forums.pragprog.com/forums/45/topics/357</link>
    </item>
  </channel>
</rss>
