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
Sort Direction Not Displaying
19/05/2010
22:47
Avatar
nickka
Member
Members
Forum Posts: 6
Member Since:
06/05/2010
sp_UserOfflineSmall Offline

I have sorting working. The sort index and the sort direction is passed to the server side where the query is ran and the results are returned as json data. The problem is that the sort direction is not being displayed in the column header. How do I get the sort direction to appear?

20/05/2010
18:38
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

The sort icon is not displayed whan the text in the header is bigger than the width. If you resize the sorted column you will see the icon

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.

20/05/2010
19:05
Avatar
nickka
Member
Members
Forum Posts: 6
Member Since:
06/05/2010
sp_UserOfflineSmall Offline

I already checked this and the column width are large enough to contain the icons, they are just not appearing. I am callind a WCF web service on the backend.

Here is my entire javascript:

jQuery().ready(function() {

//

// jQGrid Webservice Library v1.0

// http://skysanders.net/jQGridWS

//

jQuery('#theme-switcher').themeswitcher();

dataBindToGrid();

function successFunction(jsondata) {

$('.ui-jqgrid .ui-jqgrid-htable th div').css('white-space', 'normal');

$(".ui-jqgrid-sortable").css('white-space', 'normal');

$(".ui-jqgrid-sortable").css('height', 'auto');

var thegrid = jQuery("#serviceCallGridView")[0];

thegrid.addJSONData(jsondata.d);

//jQuery("#serviceCallGridView").sortGrid();

}

function getServiceCalls(pdata) {

var params = new Object();

params.page = pdata.page;

params.pageSize = pdata.rows;

params.sortIndex = pdata.sidx;

params.sortDirection = pdata.sord;

$.ajax({

url: "eAccessService.svc/GetServiceCalls?gridParams=" + JSON.stringify(params) + "&custnmbr=0206400&historyDays=50",

//url: "eAccessService.svc/GetServiceCalls?gridParams=" + JSON.stringify(params) + "&custnmbr=" + $('custnmbr').value + "&historyDays=" + $('historyDays').value,

jsonReader: {

root: "rows", //arry containing actual data

page: "page", //current page

total: "total", //total pages for the query

records: "records", //total number of records

repeatitems: false,

id: "id" //index of the column with the PK in it

},

dataType: "json",

type: "POST",

contentType: "application/json; charset=utf-8",

success: successFunction

});

}

function dataBindToGrid() {

jQuery.extend(jQuery.jgrid.defaults, {

datatype: 'json',

ajaxGridOptions: { contentType: "application/json" },

gridview: true,

rownumbers: false,

sortable: true,

headertitles: true,

viewrecords: true,

emptyrecords: "No records to view",

loadtext: "Loading...",

loadui: 'enable',

sortname: 'id'

});

$("#load_serviceCallGridView").show();

//$("#load_serviceCallGridView").css("z-index", 1000);

jQuery("#serviceCallGridView").jqGrid({

datatype: function(pdata) {

getServiceCalls(pdata);

},

caption: "Service Calls",

colNames: ['Srvc Call ID', 'Equip', 'Ref Call ID', 'City', 'ST', 'Problem Type', 'Appt Stat', 'Call Stat', 'Location'],

colModel: [{ name: 'SV00300.Service_Call_ID', index: 'SV00300.Service_Call_ID', width: 180, align: 'left', jsonmap: 'Service_Call_ID' },

{ name: 'Equipment', index: 'Equipment', width: 170, align: 'left', jsonmap: 'Equipment' },

{ name: 'Ref_Call_ID', index: 'Ref_Call_ID', width: 255, align: 'left' },

{ name: 'City', index: 'City', width: 80, align: 'left' },

{ name: 'State', index: 'State', width: 25, align: 'left' },

{ name: 'Type_Of_Problem', index: 'Type_Of_Problem', width: 200, align: 'left' },

{ name: 'Appointment_Status', index: 'Appointment_Status', width: 70, align: 'left' },

{ name: 'Status_Of_Call', index: 'Status_Of_Call', width: 70, align: 'left' },

{ name: 'Location', index: 'Location', width: 200, align: 'left' }

],

rowNum: 10,

rowList: [5, 10, 20, 50, 100],

sortname: 'SV00300.Service_Call_ID',

pager: '#pageNavigation',

sortorder: "desc",

autowidth: false,

viewrecords: true

});

jQuery("#serviceCallGridView").jqGrid('navGrid', 'pageNavigation', { edit: false, add: false, del: false });

}

});

20/05/2010
19:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You modify the sortable CSS property, so I'm not sure you will show it. Try with the original CSS definition.

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.

20/05/2010
19:47
Avatar
nickka
Member
Members
Forum Posts: 6
Member Since:
06/05/2010
sp_UserOfflineSmall Offline

I commented out the following lines:

// $('.ui-jqgrid .ui-jqgrid-htable th div').css('white-space', 'normal');

// $(".ui-jqgrid-sortable").css('white-space', 'normal');

// $(".ui-jqgrid-sortable").css('height', 'auto');

//$("#load_serviceCallGridView").show();

//$("#load_serviceCallGridView").css("z-index", 1000);

This sorting icon is still not displaying.

21/05/2010
21:45
Avatar
nickka
Member
Members
Forum Posts: 6
Member Since:
06/05/2010
sp_UserOfflineSmall Offline

Any ideas? suggestions?

26/05/2010
20:08
Avatar
nickka
Member
Members
Forum Posts: 6
Member Since:
06/05/2010
sp_UserOfflineSmall Offline

I am now investigating that possibility that the reason the sorting icons are not displaying is because I don't have the icons. For the 3.6 version of jqGrid what css are used to identify the icons and what icons are used?

30/05/2010
13:46
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

In order to work this you should include the appropriate jQuery UI theme css file.

Refer here for installation:

http://www.trirand.com/jqgridw.....to_install

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:
46 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