TreeLoader and baseParams with array

  • Hi,
    I'm a real newbie to all this I looked around for example but I could not really find one.

    I want my TreeLoader to pass extra parameters in the request. The problem is basically that I want to pass an array of country.

    Basically I would like to pass something which would look like this

    /myurl/etc?country=GB&country=CH&yearFrom=1970&yearTo=2007

    Now when I use the baseParams to do this in TreeLoader my code looks like this:
    loader: new Tree.TreeLoader({
    baseParams: {country: ["GB", "CH"], yearFrom: 1970, yearTo:2007},
    dataUrl:'/myurl/etc'
    })

    Unfortunately what is indeed sent is more a request which looks like this:
    /myurl/etc?country=GB,CH&yearFrom=1970&yearTo=2007

    Does anyone have a suggestion how I could solve this problem? I could parse the string but I would prefer to use the CountryEditor that I currently use!!!

    Thanks for your help

    Buck


  • Buck -

    I would suggest parsing the array on the server side. Arrays are converted to comma delimited lists when they are passed through a URL.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about TreeLoader and baseParams with array , Please add it free.

    7 January 2009 | cameltoepants.com | edit