Forum
12:01
28/05/2010
at first it can be work well
$("#InternetGrid").jqGrid({
url: '/PopularFeelCollect/ChildPage/Internet.aspx',
datatype: "json",
height: 340,
colNames: ['类别', '关键è¯', '最新采集时间', '采集数é‡', 'å系统采集'],
colModel: [
{ name: 'DataType', index: 'DataType', width: '15%', sortable: false, align: 'center' },
{ name: 'KeyWords', index: 'KeyWords', width: '50%', sortable: false, align: 'left' },
{ name: 'DoTime', index: 'DoTime', width: '20%', align: 'center'},
{ name: 'DataCount', index: 'DataCount', width: '15%', align: 'center', sorttype: 'int' },
{ name: 'SiteCount', index: 'SiteCount', width: '0%', hidden: true,sortable: false}
],
jsonReader: {
repeatitems: false
},
loadui: 'block',
viewrecords: true,
autowidth: true,
pagerpos: 'center',
rowNum: 20,
rowList: [10, 20, 30],
pgtext: "第 {0} 页ï¼å…± {1} 页",
recordtext: '第 {0} – {1} æ¡ å…± {2} æ¡',
emptyrecords: 'æš‚æ— è®°å½•',
pager: "#InternetPager",
onPaging: function(which_button) {
$("#InternetGrid").setGridParam({ datatype: 'json' });
},
loadError: function(xhr, status, error) {
alert(xhr.responseText);
},
loadComplete: function() {
$("#InternetGrid").setGridParam({ datatype: 'local' });
}
}).jqGrid('navGrid', '#InternetPager', { search: false, edit: false, add: false, del: false });
but after i call this Methods
$("#InternetGrid").setGridParam({ datatype: 'json', url: "/PopularFeelCollect/ChildPage/Internet.aspx?type=news", page: 1 }).trigger("reloadGrid");
click the é‡‡é›†æ•°é‡ to sort,i find it cann't sort by int.
but if i first click 最新采集时间 then click the é‡‡é›†æ•°é‡ it will be working well.
the json data
{"Id":"136","DataType":"!!未分类","KeyWords":"凤å§","DoTime":"2010-05-28 16:47:29","DataCount":1119,"SiteCount":null},
{"Id":"135","DataType":"网络å人","KeyWords":"曾哥","DoTime":"2010-05-28 14:08:25","DataCount":910,"SiteCount":null},
{"Id":"134","DataType":"网络å人","KeyWords":"春哥","DoTime":"2010-05-28 14:07:31","DataCount":1175,"SiteCount":null},
{"Id":"133","DataType":"网络å人","KeyWords":"犀利哥","DoTime":"2010-05-28 14:08:06","DataCount":3195,"SiteCount":null},
{"Id":"132","DataType":"网络å人","KeyWords":"力é‡ç”·","DoTime":"2010-05-28 14:06:50","DataCount":310,"SiteCount":null},
{"Id":"131","DataType":"网络å人","KeyWords":"芙蓉å§å§","DoTime":"2010-05-28 11:16:59","DataCount":1356,"SiteCount":null},
{"Id":"129","DataType":"网络å人","KeyWords":"æŽå®‡æ˜¥","DoTime":"2010-05-28 10:37:42","DataCount":2841,"SiteCount":null},
{"Id":"128","DataType":"网络å人","KeyWords":"曾轶å¯","DoTime":2010-05-28 11:38:52,"DataCount":0,"SiteCount":null},
{"Id":"127","DataType":"网络å人","KeyWords":"抽烟男","DoTime":"2010-05-28 11:38:52","DataCount":1001,"SiteCount":null},
{"Id":"126","DataType":"网络å人","KeyWords":"兽兽","DoTime":"2010-05-28 11:38:26","DataCount":1536,"SiteCount":null},
{"Id":"125","DataType":"网络å人","KeyWords":"闫凤娇","DoTime":"2010-05-28 11:37:57","DataCount":80,"SiteCount":null},
{"Id":"124","DataType":"网络å人","KeyWords":"åŽèˆç”·ç”Ÿ","DoTime":"2010-05-28 11:37:30","DataCount":429,"SiteCount":null},
{"Id":"123","DataType":"网络å人","KeyWords":"å°æ²ˆé˜³","DoTime":null,"DataCount":0,"SiteCount":null},
{"Id":"122","DataType":"网络å人","KeyWords":"教授","DoTime":"2010-05-28 11:36:50","DataCount":921,"SiteCount":null},
{"Id":"121","DataType":"网络å人","KeyWords":"刘谦","DoTime":"2010-05-28 11:35:22","DataCount":777,"SiteCount":null},
{"Id":"120","DataType":"网络å人","KeyWords":"陶å®å¼€","DoTime":"2010-05-28 11:35:12","DataCount":775,"SiteCount":null},
{"Id":"119","DataType":"网络å人","KeyWords":"三å£ç¨»":"2010-05-28 11:33:57","DataCount":765,"SiteCount":null},
{"Id":"118","DataType":"网络å人","KeyWords":"飞å§é‡Žç‰›","DoTime":"2010-05-28 11:32:34","DataCount":765,"SiteCount":null},
{"Id":"117","DataType":"网络å人","KeyWords":"å°èƒ–","DoTime":"2010-05-28 11:31:17","DataCount":1256,"SiteCount":null},
{"Id":"116","DataType":"网络å人","KeyWords":"éžå¸¸çœŸäºº","DoTime":"2010-05-28 11:30:22","DataCount":760,"SiteCount":null}]}
11:54
Moderators
30/10/2007
Hello,
The sorttype: 'int' have sense only if you use local data (i.e array) I think the problem is in you server side code.
Regards
Tony
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.
13:25
Moderators
30/10/2007
Hello,
If you add
sortname: "Some valid from colmodel name"
you will not have a problem. The fix is in another position of the code.
Will try to test it.
Thanks.
Best Regards
Tony
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.
11:11
Moderators
30/10/2007
Hello,
Your example work perfectly in my demo system.
The only change that I have mage is this:
onPaging: function(which_button) {
$("#InternetGrid").jqGrid('setGridParam',{ datatype: 'json' });
},
loadError: function(xhr, status, error) {
alert(xhr.responseText);
},
loadComplete: function() {
$("#InternetGrid").jqGrid('setGridParam',{ datatype: 'local' });
}
Note how this is written
Regards
Tony
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.
Most Users Ever Online: 715
Currently Online:
27 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66