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

  • SEARCH
  • Home
  • 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 8157897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:26:35+00:00 2026-06-06T17:26:35+00:00

I’m developing a web application with jax-rs, i made a rest client with jquery.

  • 0

I’m developing a web application with jax-rs, i made a rest client with jquery. I’m getting the result as json or xml, then showing them to html table. To facilitate table, im using JqGrid library. My problem is, for example Jqgrid wants to json object like below ;

[
        {yaziNo:"1",yazar:"abc",yazi:"test",tarih:"2007-10-01"}, 
        {yaziNo:"2",yazar:"cdfe",yazi:"test2",tarih:"2007-10-01"},
        {yaziNo:"3",yazar:"cdfe",yazi:"test3",tarih:"2007-10-01"}, 
        {yaziNo:"4",yazar:"abc",yazi:"test",tarih:"2007-10-01"}, 
        {yaziNo:"5",yazar:"cdfe",yazi:"test2",tarih:"2007-10-01"}, 
        {yaziNo:"6",yazar:"abc",yazi:"test3",tarih:"2007-10-01"},
        {yaziNo:"7",yazar:"cdfe",yazi:"test",tarih:"2007-10-01"},
        {yaziNo:"8",yazar:"abc",yazi:"test2",tarih:"2007-10-01"}, 
        {yaziNo:"9",yazar:"abc",yazi:"test3",tarih:"2007-10-01"}     ]

But, returned JSON from my rest server those like below;

{"yazi":
[{"tarih":"26.01.2012","yazar":"sdasdadsadasda","yazi":"gdfgdfgd","yaziNo":"1756"},
{"tarih":"26.01.2012","yazar":"sdasdadsadasda","yazi":"gdfgdfgd","yaziNo":"1755"},
{"tarih":"26.01.2012","yazar":"sdasdadsadasda","yazi":"gdfgdfgd","yaziNo":"1754"},
{"tarih":"26.01.2012","yazar":"sdasdadsadasda","yazi":"gdfgdfgd","yaziNo":"1753"},
{"tarih":"26.01.2012","yazar":"sdasdadsadasda","yazi":"gdfgdfgd","yaziNo":"1752"}]
}

How can i delete the “yazi” node but keeping inside.

edited:

jQuery("#list27").jqGrid({
    url:'http://localhost:43842/KodcuComRESTful/kodcuRS/yazilar',
    datatype: "json",
    height: 255,
    width: 700,
    jsonReader: {root: "yazi", repeatitems: false},
    colNames:['Yazi No','Yazar', 'Yazi', 'Tarih'],
    colModel:[
        {name:'yaziNo',index:'yaziNo', width:80, sorttype:"int"},
        {name:'yazar',index:'yazar', width:180}, 
        {name:'yazi',index:'yazi', width:370}, 
        {name:'tarih',index:'tarih', width:100, align:"right",sortype:"date"}
    ],
    rowNum:10,
    rowTotal: 2000,
    rowList : [20,30,50],
    loadonce:true,
    mtype: "GET", 
    rownumbers: true,
    rownumWidth: 40, 
    gridview: true, 
    pager: '#pager27',
    sortname: 'yaziNo',
    viewrecords: true,
    sortorder: "asc",
    caption: "Loading data from server at once"
});
  • 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-06T17:26:36+00:00Added an answer on June 6, 2026 at 5:26 pm

    I see no problem with the data returned from the server. You should just use jsonReader option of jqGrid which informs jqGrid how to read the data from the server response. For example

    jsonReader: {root: "yazi", repeatitems: false}
    

    UPDATED: The demo uses the exact JSON data which you posted and it displays the results in the grid. I used the JavaScript code which you posted and replaced only height: 255 to height: "auto" to have more compact results.

    enter image description here

    The only problem which I see in your code is the usage of full URL: url:'http://localhost:43842/KodcuComRESTful/kodcuRS/yazilar'. Because of same origin policy restriction one can’t get JSON data per Ajax from another source as the same site and port. So in case of usage datatype: "json" you should always use relative URL path like url:'/KodcuComRESTful/kodcuRS/yazilar' for example.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
In my XML file chapters tag has more chapter tag.i need to display chapters
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an XML file, the creators of it stuck in a bunch social

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.