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
jqGrid with Json data (Error: Unable to get property '0' of undefined or null reference)
11/03/2013
16:07
Avatar
galastur
New Member
Members
Forum Posts: 2
Member Since:
11/03/2013
sp_UserOfflineSmall Offline

Hi All,

I am trying to display some data in a jqGrid but I get the following error: Unable to get property '0' of undefined or null reference

The data looks like this:

{"total":2,"page":0,"records":27,"rows":[{"DeletedFlag":"N","Filename":"\\\\mypath\\myfile.txt","VideoId":"12345"},{"DeletedFlag":"Y","Filename":"\\\\mypath\\otherfile.txt","VideoId":"88888"}]}

 And here is the grid definition:

function displayGrid() {

jQuery("#grid").jqGrid({

url: '@Url.Action("GetGrids", "Home")',

datatype: "json",

beforeRequest: function () {

alert("Going to get data");

},

gridComplete: function () {

alert("all done");

},

mtype: 'POST',

colNames: ['VideoId', 'Filename', 'DeletedFlag'],

colModel: [

{ name: 'VideoId', index: 'VideoId',jsonmap: 'VideoId', width: 200, sortable: false, editable: false, editoptions: { readonly: true, size: 10} },

{ name: 'Filename', index: 'Filename', jsonmap: 'FileName', width: 600, editable: false },

{ name: 'DeletedFlag', index: 'DeletedFlag', jsonmap: 'DeletedFlag', width: 100, editable: true }

],

jsonReader: {

root: "rows",

page: "page",

total: "total",

records: "records",

repeatitems: true

},

rowNum: 10,

rowList: [10, 20, 30],

pager: jQuery('#gridpager'),

sortname: 'VideoId',

viewrecords: true,

sortorder: "asc",

caption: "Orphans",

editurl: '@Url.Action("UpdateGridItem")'

}).navGrid('#gridpager');

}

 
Any help will be great. 

11/03/2013
16:20
Avatar
galastur
New Member
Members
Forum Posts: 2
Member Since:
11/03/2013
sp_UserOfflineSmall Offline

I have just re-read the API and found that when using the json maping the repeatitems should be false!

repeatitems: false

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
55 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