Hybrid View

  1. #1
    Ext User
    Join Date
    Jun 2007
    Posts
    23
    Vote Rating
    0
    xerifa is on a distinguished road

      0  

    Question Some Problem with JSON

    Some Problem with JSON


    Hi,

    Just downloaded the cool ext-2.1. Was looking at the example of layout-browser.But there is a minor glitch which i'm not able to get thru.

    Online http://www.extjs.com/deploy/dev/exam...t-browser.html this seems to work absolutely fine with all entries getting loaded up in respective layout categories like Basic Ext Layout,custom Layout etc.

    But when i tried to run the same example offline thru the downloaded ext 2.1 kit, tree-data.json file which it seems to reference does not load the required data like accordion,anchor,border etc. onto the example.

    If somebody can help me in getting to run the example offline...Why Json is not loading..

    Regards

    Mayank

  2. #2
    Ext User
    Join Date
    Jul 2007
    Posts
    3,128
    Vote Rating
    1
    devnull is an unknown quantity at this point

      0  

    Default


    This has been answered many times; XHR requires a webserver to work properly. There are some workarounds available, but i do not recall what exactly those are.

  3. #3
    Ext User
    Join Date
    Jun 2007
    Posts
    23
    Vote Rating
    0
    xerifa is on a distinguished road

      0  

    Default JSON data not loading onto treeloader

    JSON data not loading onto treeloader


    HI Dev,

    I'm using IIS 5.1 and i tried adding MIME type json.Also I ran the example in my localhost but still i'm unbale to get the data displayed onto the tree.

    Please help me in fixing this.

    Regards

    Mayank

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,019
    Vote Rating
    650
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Look at the response in firebug.

  5. #5
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    At least one of the tree examples uses php for the backend to get the files. That php file assumes json_encode is available, which your version of php may not have. See the stickied thread this forum on json encoding if this sounds like it might be your issue (it's not just php4, it's like php <5.1 or 5.2 or something).

  6. #6
    Ext User
    Join Date
    Jun 2007
    Posts
    23
    Vote Rating
    0
    xerifa is on a distinguished road

      0  

    Red face Got it working with xampp

    Got it working with xampp


    Hi All,

    I got the layout browser example working by installing xampp 1.6.6a on my system and placing the EXT 2.1 folder in htdocs folder.

    I usually code in vs 2005 and depend on IIS 5.1.So when it clicked to me that php might be missing link i correctly installed php-5.2.5 but still i was not able to run example with IIS.

    Any suggestions to run example through IIS might be welcome.

    Regards

  7. #7
    Ext User
    Join Date
    Jun 2007
    Posts
    23
    Vote Rating
    0
    xerifa is on a distinguished road

      0  

    Default


    For IIS the response is "HTTP 405 - Resource not allowed Internet Information Services".Its basically an ajax request in ext-base.js which ask for "application/json" but IIS is not permitting the request to go through.

    Please let me know the workaround for IIS 5.1 so that this example can run on it.

  8. #8
    Ext User
    Join Date
    Jun 2007
    Posts
    23
    Vote Rating
    0
    xerifa is on a distinguished road

      0  

    Default


    I'm still unable to run the example in localhost of IIS.Firebug Console gives me error "POST http://localhost:9090/Project/tree-data.json 405 (735ms)

    I have attached console.txt to show exact error details.

    Also i made a change in IIS (Defaul website properties > HTTP Headers >MIME Type and added .json as "text/javascript" as coded in ext-base.js

    I tried Mime type as "text/plain" and "text/html"...It still did'nt worked.

    "Ext.lib.Ajax={request:function(K,I,E,J,F)............."

    But it is still not working

    Please let me know how to correct this problem
    Attached Files

  9. #9
    Ext User
    Join Date
    Jun 2007
    Posts
    23
    Vote Rating
    0
    xerifa is on a distinguished road

      0  

    Default JSON not working on IIS 5.1

    JSON not working on IIS 5.1


    Hi All,

    I really need help of you guys on this. I have banged my head to much extent and still haven't got it solved.

    Issue is treeloader which loads json data in tree panel is not displayed through IIS webserver though xampp loads it just fine.Infact I tried running localhost/example.json and it displayed json file contents on xampp while IIS didn't recognise the file type and hence didn't opened.

    I tried changing MIME type in IIS viz.
    .json = "text/plain","text/html","text/json","application/json" and nothing worked.

    In IIS i also tried to set header type i.e content-type="application/json"...It did'nt worked..

    Also in treeloader requestmethod which is default "POST" i tried changing it to "GET"...

    Still i'm not able to work this....I will be working on weekend to just solve this..

    Please help me out solve this

  10. #10
    Sencha - Community Support Team JeffHowden's Avatar
    Join Date
    Mar 2007
    Location
    Forest Grove, OR
    Posts
    1,038
    Vote Rating
    1
    JeffHowden is on a distinguished road

      0  

    Default


    What happens when you request that file directly via IIS?
    Jeff Howden
    Ext JS - Support Team Volunteer
    jeff@extjs.com

    Any and all code samples that are authored by me and posted on the Ext forums or website are hereby released into the public domain and I release anyone or entity of liability by using said code samples unless explicitly stated otherwise.

    Opinions are mine and not necessarily endorsed by Ext, LLC. Please do not contact me directly for assistance unless requested by me.