Home > Net >  Jqgrid postData problem
Jqgrid postData problem

Time:02-25

As title, while using jqgrid found postData submitted to the background data, cannot resolve PageSearch entity attribute in the class, this property is always NULL, the rest can be parsed to, postData cannot parse the json?
Trouble, have a look at the problem there
The code below
 
//JS query
The function searchData () {//search

Var json={
The entity: {
Rc_name: 11,
Urc_name: 222
},
KeyWords: "2323545"
};
//alert (JSON. Stringify (JSON));
//XPage. Search (json);


Var t=$(" # table_list "). The jqGrid (" getGridParam ", "postData");
$. The extend (t, json);
Alert (JSON. Stringify ($. The extend (t, JSON)));
$(" # table_list "). SetGridParam ({
Search:! 0
}). The trigger (" reloadGrid ", [{
Page: 1
}])

}


 
//this is the front desk to print the json
{
"_search" : false,
"Nd" : 111,
"Rows" : 15,
"Page" : 1,
"Sidx" : ", "
"Sord" : "asc",
"Entity" : {
"Rc_name" : 11,
"Urc_name" : 2222
},
"KeyWords" : "2323545"
}

 
//the background define query entity class
///& lt; Summary>
///paging query conditions entity
///& lt;/summary>
///& lt; Typeparam name="T" & gt; The entity & lt;/typeparam>
Public class PageSearch Where T: BaseEntity, new ()
{
///& lt; Summary>
What page
///the current///& lt;/summary>
Public string page {get; The set; }

///& lt; Summary>
///how much each page article
///& lt;/summary>
Public string rows {get; The set; }

///& lt; Summary>
///entity query condition
///& lt;/summary>
[DataMember]
Public entity T {get; The set; }

Public string keyWords {get; The set; }
}

  •  Tags:  
  • C#
  • Related