Results 1 to 4 of 4

Thread: About define a JsonStore issue, can not assignment for store?Help!

  1. #1

    Default About define a JsonStore issue, can not assignment for store?Help!

    Code:
    Code:
    var store = new Ext.data.JsonStore({
        proxy : new Ext.data.HttpProxy({
            url: 'NcServlet?methodName=getNcipList',
        }),
        reader : new Ext.data.JsonReader({
            totalProperty : 'count',
            root : 'nc'
        })
        ,fields : [{name:"ncname", type:"string"} ,{name:"ncip", type:"string"}]
    });
     
    store.load();


    My json data is:
    Code:
    {"count":1,"nc":[{"ncname":"nc_0","ncip":"192.168.0.52"}]}
    


    the question is i can not assignment for store,
    the request can be sended to server,server can return json data to javascript,
    I guess the issue is happended to extjs code,please help!
    my extjs version is 3.3.1

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Are you seeing an error in the console?

  3. #3

    Default

    console doesn't output any error,
    i post my server code?Is there a problem with my server code?
    Code:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            // TODO Auto-generated method stub
            
            try{
                request.setCharacterEncoding("UTF-8");
                response.setCharacterEncoding("UTF-8");
                response.setContentType("text/html");
                PrintWriter out = response.getWriter();
                String method = request.getParameter("methodName");
                String ret  = "";
                if(method.equals("getNcipList")){
                    ret = new WsClient().sendREP("getNcipList", "").toString();
                    //ret = {"count":1,"nc":[{"ncname":"nc_0","ncip":"192.168.0.52"}]}
                }
                out.print(ret);
            }catch(Exception e){
                e.printStackTrace();
            }
        }

  4. #4

    Default

    Quote Originally Posted by Gary Schlosberg View Post
    Are you seeing an error in the console?
    console doesn't output any error,
    i post my server code?Is there a problem with my server code?

    Code:
        
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            // TODO Auto-generated method stub
            
            try{
                request.setCharacterEncoding("UTF-8");
                response.setCharacterEncoding("UTF-8");
                response.setContentType("text/html");
                PrintWriter out = response.getWriter();
                String method = request.getParameter("methodName");
                String ret  = "";
                if(method.equals("getNcipList")){
                    ret = new WsClient().sendREP("getNcipList", "").toString();
                    //ret = {"count":1,"nc":[{"ncname":"nc_0","ncip":"192.168.0.52"}]}
                }
                out.print(ret);
            }catch(Exception e){
                e.printStackTrace();
            }
        }




Similar Threads

  1. about define a JsonStore issue, can not assignment for store?Help!
    By yagami123551 in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 25 May 2016, 4:02 PM
  2. Dynamic store assignment to combobox
    By RodS1967 in forum Ext: Q&A
    Replies: 10
    Last Post: 11 Jul 2014, 10:12 AM
  3. Replies: 7
    Last Post: 15 Apr 2013, 5:42 AM
  4. Late store assignment
    By mehran in forum Community Discussion
    Replies: 3
    Last Post: 7 Feb 2012, 6:01 AM
  5. Issue to define Store in MVC application
    By metfan in forum Ext: Discussion
    Replies: 3
    Last Post: 28 Apr 2011, 12:00 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •