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
after reload the sort can't work well
28/05/2010
12:01
Avatar
nanlinfeixue
Member
Members
Forum Posts: 7
Member Since:
28/05/2010
sp_UserOfflineSmall Offline

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

{"total":"7","records":"123","page":"1","rows":[
{"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}]}
30/05/2010
11:54
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

31/05/2010
04:12
Avatar
nanlinfeixue
Member
Members
Forum Posts: 7
Member Since:
28/05/2010
sp_UserOfflineSmall Offline

hello ,Tony

you see i set the datatype:local

 loadComplete: function() {
            $("#InternetGrid").setGridParam({ datatype: 'local' });
        }

so i think is a bug

thanks

Best regards

jerry

01/06/2010
13:25
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

02/06/2010
04:53
Avatar
nanlinfeixue
Member
Members
Forum Posts: 7
Member Since:
28/05/2010
sp_UserOfflineSmall Offline

hello ,

I added sortname: "DoTime",

Using the latest version 3.7 bata, all the columns can not be sort.

Using the version 3.6.5,the problem is still.

Thanks.

Best Regards

Jerry

02/06/2010
11:11
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

Forum Timezone: Europe/Sofia

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.com

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

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information