Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8035421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:18:11+00:00 2026-06-05T02:18:11+00:00

This my ExtJS code to show my records in grid. var remoteProxy = new

  • 0

This my ExtJS code to show my records in grid.

   var remoteProxy = new Ext.data.ScriptTagProxy({
                url : 'hastanebilgilerinigetir'
            });

            var recordFields = [
                                { name : 'hid',          mapping : 'hid'},
                                { name : 'isim',   mapping : 'isim'},
                                { name : 'adres',    mapping : 'adres'},
                                { name : 'telefon',      mapping : 'telefon'},
                                { name : 'bashekimid',        mapping : 'bashekimid' }
            ];

            var remoteJsonStore = new Ext.data.JsonStore({
                proxy           : remoteProxy,
                storeId         : 'ourRemoteStore',
                root            : 'records',
                autoLoad        : false,
                //totalProperty   : 'totalCount',
                remoteSort      : true,
                fields          : recordFields,
                idProperty      : 'hid'
            });

            var textFieldEditor = new Ext.form.TextField();

            var numberFieldEditor = {
                    xtype     : 'numberfield',
                    minLength : 5,
                    maxLength : 5
            };

            var columnModel = [
                               {
                                   header    : 'Hastane Adı',
                                   dataIndex : 'isim',
                                   sortable  : true,
                                   editor    : textFieldEditor
                               },
                               {
                                   header    : 'Telefon',
                                   dataIndex : 'telefon',
                                   sortable  : true,
                                   editor    : textFieldEditor
                               },
                               {
                                   header    : 'Adres',
                                   dataIndex : 'adres',
                                   sortable  : true,
                                   editor    : textFieldEditor
                               },
                               {
                                   header    : 'Baş Hekim ID',
                                   dataIndex : 'bashekimid',
                                   sortable  : true,
                                   editor    : numberFieldEditor
                               },
                               {
                                   header    : 'Hastane ID',
                                   dataIndex : 'hid',
                                   sortable  : true,
                                   editor    : numberFieldEditor
                               }
                               ];
    var grid = {
            xtype      : 'editorgrid',
            columns    : columnModel,
            id         : 'myEditorGrid',
            store      : remoteJsonStore,
            loadMask   : true,
            bbar       : pagingToolbar,
            stripeRows : true,
            viewConfig : {
                forceFit : true
            },
            listeners        : {
                cellcontextmenu : doCellCtxMenu,
                destroy         : function(thisGrid) {
                    if (thisGrid.rowCtxMenu) {
                        thisGrid.rowCtxMenu.destroy();
                    }
                }
            }
    };

    var hastanegridi = new Ext.Panel({
        title: 'Hastaneler',
        height  : 700,
        width   : 950,
        border  : false,
        layout  : 'fit',
        items   : grid
    });


    remoteJsonStore.load({
        params : {
            start : 0,
            limit : 50
        }
    });

I have the following java code to create JSONObject

    @Override
    public JSONObject listHastanesAsJson() {
        List<Hastane> lst = hastaneDao.listHastane();

        JSONArray arr = new JSONArray();

//      int i=lst.size();
//      JSONObject counter = new JSONObject();
//      counter.put("totalCount", i);
//      arr.add(counter);


        for(Hastane kan:lst){

            JSONObject obj = new JSONObject();

            obj.put("hid", kan.getHid());
            obj.put("isim", kan.getIsim());
            obj.put("adres", kan.getAdres());
            obj.put("telefon", kan.getTelefon());
            obj.put("bashekimid", kan.getBahekimid());
            arr.add(obj);
        }


        JSONObject o = new JSONObject();
        o.put("records", arr);
        return o;
    }

My Json data look like :

{"records":[{"hid":1,"isim":"Zeynep Kamil","adres":"Istanbul","telefon":"056765434567","bashekimid":1},{"hid":2,"isim":"Ankara Hastanesi","adres":"Ankara","telefon":"345678987658","bashekimid":2},{"hid":3,"isim":"Baskent Hastanesi","adres":"Ankara","telefon":"567898765697","bashekimid":3}]}

But when I try to show my data in browser I get error below “İnvalid label”

enter image description here

Is there a mistake when I create JSONObject in server side?

My json data must be something like in this link but I don’t know how to construct my data like this: http://extjsinaction.com/dataQuery.php

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:18:13+00:00Added an answer on June 5, 2026 at 2:18 am

    You are using Ext.data.ScriptTagProxy witch is for JSONP (cross domain requests)

    your request url should be something like this:

    http://extjsinaction.com/dataQuery.php?callback=callbackFunction

    your response should be like this:

    callbackFunction({
        "records": [
            {
                "hid": 1,
                "isim": "Zeynep Kamil",
                "adres": "Istanbul",
                "telefon": "056765434567",
                "bashekimid": 1
            },
            {
                "hid": 2,
                "isim": "Ankara Hastanesi",
                "adres": "Ankara",
                "telefon": "345678987658",
                "bashekimid": 2
            },
            {
                "hid": 3,
                "isim": "Baskent Hastanesi",
                "adres": "Ankara",
                "telefon": "567898765697",
                "bashekimid": 3
            }
        ]
    })
    

    If you need more info about JSONP google is your friend.

    Some good examples in documentation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this article of architecture http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/ in my code: I have this
In ExtJS version 3, there was a property grid in Ext.grid.RowSelectionModel and in version
I'm still new to ExtJS and I cannot figure out how to get code-generated
I am using ExtJS Forms. My form code is as follows: Ext.create('Ext.form.Panel', { width:
Just FYI this code is part of ExtJS 4 script. I have a global
I am working through this extJS tutorial where you type in code into Firebug,
I am using this article of architecture http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/ I have this one function where
I am using this article of architecture http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/ Here is my Application.ResellerGrid.js Application.ResellerGrid =
I have problems getting data from grails using extjs. My Grails controller code is:
this code working in extjs 3 but now i convet my app to extjs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.