Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
json troubles
Tags: json
31/03/2014
23:42
Avatar
BlueDevil63
New Member
Members
Forum Posts: 1
Member Since:
31/03/2014
sp_UserOfflineSmall Offline

So I have spent a couple days on this with no luck. Here is the HTML file:

<!DOCTYPE html>

<html>

<head>

<title>Test</title>

<link rel="stylesheet" type="text/css" media="screen" href="css/ui-lightness/jquery-ui-1.10.4.custom.css" />

<link rel="stylesheet" type="text/css" media="screen" href="css/ui.jqgrid.css" />

<style>

html, body {

margin: 0;

padding: 0;

font-size: 75%;

}

</style>

<script src="js/jquery-1.11.0.js"></script>

<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>

<script src="js/jquery.jqGrid.src.js" type="text/javascript"></script>

<script>

function filljqGrid() {

jQuery("#orders").jqGrid({

url : "http://127.0.0.1:5000",

datatype : "json",

mtype : "GET",

height : "auto",

sortname : 1,

rowNum : 10,

rowList : ['10', '20', '30'],

colNames : ['Id', 'GeneratedBy', 'Type', 'Route', 'State', 'TimeCreated'],

colModel : [{name : 'id', index : 1, width : 60},

{name : 'generatedBy', index : 2, width : 90, align : "right"},

{name : 'type', index : 3, width : 100, align : "right"},

{name : 'route', index : 4, width : 80, align : "right"},

{name : 'state', index : 5, width : 80, align : "right"},

{name : 'timecreated', index : 6, width : 80, align : "right"}],

pager : "#pager",

multiselect : true,

viewrecords : true,

caption : "Manipulating Array Data"

});

}

 

jQuery(document).ready(function () {

filljqGrid();

});

</script>

</head>

<body>

<table id="orders"></table>

<div id="pager"></div>

</body>

</html>

Simple grid. Loads from json fetched from the indicated URL. 6 columns. I have tried this basic grid with local data and it works fine. I am using a Python Flask server running at 127.0.0.1:5000 to deliver data to jqGrid. I see the request hit the data server when the page loads and the data server returns this exact string on the initial load of the page. Content type is indicated as json in the response.

{

"page": "1",

"total": "2",

"records": "16",

"rows": [

{

"id": "0",

"cell": [

"070716da-8d2a-11e3-83a5-d43d7ebceb52",

"TRADER1",

"MARKET",

"TEST",

"CREATED",

"Mon, 03 Feb 2014 23:22:24 GMT"

]

},

{

"id": "1",

"cell": [

"19e45f30-8f99-11e3-b171-d43d7ebceb52",

"TRADER1",

"STRATEGY",

"TEST",

"CREATED",

"Fri, 07 Feb 2014 01:42:27 GMT"

]

},

{

"id": "2",

"cell": [

"3d4cc730-8d2a-11e3-830d-d43d7ebceb52",

"TRADER1",

"STRATEGY",

"TEST",

"CREATED",

"Mon, 03 Feb 2014 23:23:53 GMT"

]

},

{

"id": "3",

"cell": [

"44fd38aa-8f98-11e3-9d4c-d43d7ebceb52",

"TRADER1",

"MARKET",

"TEST",

"CREATED",

"Fri, 07 Feb 2014 01:36:30 GMT"

]

},

{

"id": "4",

"cell": [

"469baed0-8f98-11e3-9d4c-d43d7ebceb52",

"TRADER1",

"STRATEGY",

"TEST",

"CREATED",

"Fri, 07 Feb 2014 01:36:33 GMT"

]

},

{

"id": "5",

"cell": [

"6731a968-9440-11e3-be89-d43d7ebceb52",

"TRADER1",

"MARKET",

"TEST",

"CREATED",

"Wed, 12 Feb 2014 23:50:08 GMT"

]

},

{

"id": "6",

"cell": [

"77b8c764-9056-11e3-b996-d43d7ebceb52",

"TRADER1",

"STRATEGY",

"TEST",

"CREATED",

"Sat, 08 Feb 2014 00:18:03 GMT"

]

},

{

"id": "7",

"cell": [

"86db314c-9442-11e3-be89-d43d7ebceb52",

"TRADER1",

"STRATEGY",

"TEST",

"CREATED",

"Thu, 13 Feb 2014 00:05:20 GMT"

]

},

{

"id": "8",

"cell": [

"a3706c74-9441-11e3-be89-d43d7ebceb52",

"TRADER1",

"MARKET",

"TEST",

"CREATED",

"Wed, 12 Feb 2014 23:58:58 GMT"

]

},

{

"id": "9",

"cell": [

"bc9e10c4-8add-11e3-b1e8-d43d7ebceb52",

"TRADER1",

"STRATEGY",

"TEST",

"CREATED",

"Sat, 01 Feb 2014 01:11:10 GMT"

]

}

]

}

But nothing shows up in the grid. The grid frame shows up but no data. Anything really obvious I am doing wrong here?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
66 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information