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
Sorting disabled but still sorts
24/05/2010
17:58
Avatar
garethahealy
Member
Members
Forum Posts: 5
Member Since:
24/05/2010
sp_UserOfflineSmall Offline

I am having trouble with sorting columns. Even though i disable some columns to not be sortable, when i click on them, they go away to the server to sort.

Below is the standard settings i use for all my grids:

setupJqGridDefaults: function() {
            $.jgrid.defaults = $.extend($.jgrid.defaults, {
                autowidth: true,
                datatype: 'json',
                gridview: true,
                height: 'auto',
                imgpath: '/Content/Images/JQuery-UI',
                jsonReader: {
                    id: 'Id',
                    page: 'Page',
                    total: 'Total',
                    records: 'Records',
                    repeatitems: false,
                    root: 'Rows',
                    userdata: 'UserData'
                },
                loadui: 'block',
                mtype: 'GET',
                multiboxonly: true,
                multiselect: true,
                pager: '#pager',
                rowNum: 10,
                rowList: [10, 20, 30, 40, 50, 100],
                sortorder: 'asc',
                viewrecords: true
            });
        }

I then have custom settings for the actual grid on the page:

setupJqGrid: function() {
            $.jgrid.defaults = $.extend($.jgrid.defaults, {
                colNames: ['', 'Identifier', 'Title', 'Category', 'CurrentLocation', 'CurrentOwner', 'Status'],
                colModel: [
                                { name: 'Id', index: 'Id', editable: false, hidden: true, key: true },
                                { name: 'Identifier', index: 'Identifier', editable: false, hidden: false, sort: true },
                                { name: 'Title', index: 'Title', editable: false, hidden: false, sort: true },
                                { name: 'Category', index: 'TrackedItemCategory.Description', editable: false, hidden: false, sort: true },
                                { name: 'Location', index: 'Location', editable: false, hidden: false, sort: false },
                                { name: 'Username', index: 'Username', editable: false, hidden: false, sort: false },
                                { name: 'Status', index: 'Status', editable: false, hidden: false, sort: true }
                              ],
                sortname: 'Identifier',
                url: 'GetDataAsJson',
                multiselect: false,
                loadComplete: function(xhr) {
                    var userData = $('#grid').getGridParam('userData');
                    if (userData) {
                        displayErrorMessage(userData);
                    }
                },
                loadError: function(xhr, status, error) {
                    window.location.replace('Exception/HandleException');
                }
            });
        },

And finally, load the grid:
       

loadJqGrid: function(grid) {
            var lastsel;
            grid.jqGrid({
                onSelectRow: function(id) {
                    lastsel = selectedRow(id, lastsel);
                }
            });
        }

As you can see, 2 columns are not sortable, but are still clickable.

Any ideas what i am doing wrong? or is this a feature?

Cheers.

24/05/2010
18:20
Avatar
garethahealy
Member
Members
Forum Posts: 5
Member Since:
24/05/2010
sp_UserOfflineSmall Offline

PS: Am using v3.6.5

17/07/2010
06:16
Avatar
ralpha
New Member
Members
Forum Posts: 1
Member Since:
19/10/2009
sp_UserOfflineSmall Offline

It's a bug.  I went to v3.7.2 and it fixed the problem.  BTW....the bug only occurred in Firefox.  IE7 worked.   V3.7.2 works for both

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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