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_TopicIcon
jqgrid conversion error when use postData to send param
31/10/2014
16:08
Avatar
Farooq Tahir
New Member
Members
Forum Posts: 2
Member Since:
31/10/2014
sp_UserOfflineSmall Offline

Hi, 

I'm getting following error when using postData to send parameter to load records in grid. 

"Cannot convert object of type 'System.String' to type 'System.Collections.Generic.IDictionary`2[System.String,System.Object]"

below is my code:

jQuery("#jQGridStudents").jqGrid({
loadError: function(xhr, status, error) {
Notify('Error', error);},
url: './mytestpage.aspx/GetStudentsList',
mtype: 'POST',
postData: "{showAll: '" + $("#chkShowAll").prop("checked") + "'}",
datatype: "json",
ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
serializeGridData: function(postData) {
alert(postData);
return JSON.stringify(postData);
},
jsonReader: {
root: function(obj) { return obj.d; },
page: function(obj) { return obj.d.page; },
total: function(obj) { return obj.d.total; },
records: function(obj) { return obj.length; },
id: 'ID',
cell: '',
repeatitems: false
},

 

When i remove the serializeGridData property record get loaded but the built in search stop workring. I am using inline navigation along with auto search true as below

 $('#jQGridStudents').jqGrid('filterToolbar', { autosearch: true, searchOnEnter: false });

Any suggestions where i'm doing wrong?

03/11/2014
18:19
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

 

postData is a object and not a string. In your implementation you set it as string.

 

Regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

05/11/2014
10:22
Avatar
Farooq Tahir
New Member
Members
Forum Posts: 2
Member Since:
31/10/2014
sp_UserOfflineSmall Offline

Thanks! Its work after setting postDate as object instead of string.

09/11/2014
11:40
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

 

Thanks for feedback.

 

Regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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