Apr 8, 2008
Generic-user-small Stéphane Boi... 5 posts

Topic: Prototype and script.aculo.us / binding? scoping?

Answered it myself the offending line is this:
var GroupNames = arg.responseText.pluck(‘FieldGroupID’);

For some strange reason I thought since I did a JSON response header that it would be automatically into a JSON array. doing an evail before the pluck solved the problem.
Christophe, Is there some easier way to get the json evaluated response?

 
Apr 8, 2008
Generic-user-small Stéphane Boi... 5 posts

Topic: Prototype and script.aculo.us / binding? scoping?

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);
          })
        }
    }
    );
}

Clarifications: (En Francais sa va etre plus facile bon)
GroupNames deviens un array de ID de element ul
dans le log de firebug foo1 apparait mais foo2, foo3 et la variable option n’apparaise pas.

Merci pour ton temps, C’est vraiment apprécié.

 
Apr 7, 2008
Generic-user-small Stéphane Boi... 5 posts

Topic: Prototype and script.aculo.us / binding? scoping?

Bonjour,

I was wondering if you could help me out with a little problem. I am doing something based on the dragdrop 5 example.

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); }) } } ); }

Now strangely the Groups (a JSON 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… I<m foolish be very something to bound this i is sure><m of aware not jsut>

thanks

 
Mar 30, 2008
Generic-user-small Stéphane Boi... 5 posts

Topic: Prototype and script.aculo.us / Prototype Code Insigh (auto complete, Intelisense etc)

Christophe,

As for the second part of my message reading it now… I have no idea what I was thinking… some strange coffee hallucination maybe….
As for IDE’s with Dynamic languages I have had an incredible with PHP on the PhpED and ZDE Studios with their magic figuring out variables type and object types and such and was therefore hoping to see something of the like to remind me of the arguments and the function names. a cheat sheet on the second monitor could be almost as useful.

thanks again.

 
Mar 22, 2008
Generic-user-small Stéphane Boi... 5 posts

Topic: Prototype and script.aculo.us / Prototype Code Insigh (auto complete, Intelisense etc)

Good day, Thank you for a great book Christophe,
I was wondering if you had any suggestions as to an IDE (or eclipse plug in [JSEclipse doesn’t seem to work]) that would do prototype code completion for those of us who have “difficulties” with remembering functions and writing in general. Also I just had a few comments, On page 82 (and others) there are the examples now I am pretty sure I know why $R(1,20).include(12) is true [because 1 evaluate to true and so does 12] but I would like to a small explication beside the answers that might not be fully certain or fully certain.

Merci!

5 posts