On 10/17/06, Chris <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> In the ajax_tables example the JSON file's url is hardcoded. I tried to
> adjust ajax_tables.js to allow a dynamic file but I get the following
> error:
>
> this.thead has no properties, ajax_tables.js (line 206)
>
> What I'm doing is adding a 'url' parameter to
> sortableManager.initialize and then passing the json file's url at
> addLoadEvent(...);.
>
> For example:
>
> (original)
>
> SortableManager.prototype = {
>
>     "initialize": function () {
> ...
>         this.loadFromURL("json", "domains.json");
>     },
> ...
> };
>
> // create the global SortableManager and initialize it on page load
> sortableManager = new SortableManager();
> addLoadEvent(sortableManager.initialize);
>
> (what i changed it to)
>
> SortableManager.prototype = {
>
>     "initialize": function (url) {
> ...
>         this.loadFromURL("json", url); //"domains.json");
>     },
> ...
> };
>
> // create the global SortableManager and initialize it on page load
> sortableManager = new SortableManager();
> addLoadEvent(sortableManager.initialize("domains.json"));

This is the same problem you had last week. Your code is doing this,
which makes no sense:

    var res = sortableManager.initialize("domains.json");
    addLoadEvent(res);

The solution is the same: create a new function that does
sortableManager.initialize("domains.json").

Like this:
    addLoadEvent(function () { sortableManager.initialize("domains.json"); });

-bob

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to