Forum

July 12th, 2025
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
Auto scroll horizontally when too many column
06/12/2009
03:44
Avatar
markthien
Member
Members
Forum Posts: 5
Member Since:
13/11/2009
sp_UserOfflineSmall Offline

Hi guys,

    I need to display like 30 columns in jqgrid. Is there any configuration which I can configure to tell jqgrid to auto scroll horizontally within the grid itself? I always get the data like below:

jQuery("#list").jqGrid({
   url:'server.php?q=2',
datatype: "json",
   colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes','Inv No','Date', 'Client', 'Amount','Tax','Total','Notes','Inv No','Date', 'Client', 'Amount','Tax','Total','Notes','Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
   colModel:[
   {name:'id',index:'id', width:55},
   {name:'invdate',index:'invdate', width:90},
   {name:'name',index:'name asc, invdate', width:100},
   {name:'amount',index:'amount', width:80, align:"right"},
   {name:'tax',index:'tax', width:80, align:"right"},
   {name:'total',index:'total', width:80,align:"right"},
   {name:'note',index:'note', width:150, sortable:false},

   {name:'id',index:'id', width:55},
   {name:'invdate',index:'invdate', width:90},
   {name:'name',index:'name asc, invdate', width:100},
   {name:'amount',index:'amount', width:80, align:"right"},
   {name:'tax',index:'tax', width:80, align:"right"},
   {name:'total',index:'total', width:80,align:"right"},
   {name:'note',index:'note', width:150, sortable:false},

   {name:'id',index:'id', width:55},
   {name:'invdate',index:'invdate', width:90},
   {name:'name',index:'name asc, invdate', width:100},
   {name:'amount',index:'amount', width:80, align:"right"},
   {name:'tax',index:'tax', width:80, align:"right"},
   {name:'total',index:'total', width:80,align:"right"},
   {name:'note',index:'note', width:150, sortable:false},  

   {name:'id',index:'id', width:55},
   {name:'invdate',index:'invdate', width:90},
   {name:'name',index:'name asc, invdate', width:100},
   {name:'amount',index:'amount', width:80, align:"right"},
   {name:'tax',index:'tax', width:80, align:"right"},
   {name:'total',index:'total', width:80,align:"right"},
   {name:'note',index:'note', width:150, sortable:false}
   ],
   rowNum:10,
   rowList:[10,20,30],
   pager: '#pager2',
   sortname: 'id',
    viewrecords: true,
    sortorder: "desc",
    caption:"JSON Example"
});

However, under the colModel and colNames, I will have like 30 columsn and once everything loaded, the browser scroll horizontally instead of the jqgrid itself.

Appreciate any help pls. Thanks !

regards,

Mark Thien

07/12/2009
09:43
Avatar
Rumen[Trirand]
Moderator
Members

Moderators
Forum Posts: 81
Member Since:
08/10/2009
sp_UserOfflineSmall Offline

Hello,

Try setting width for the grid itself (in addition to the columns). There is a top-level width property of the grid, I see you have not set it - setting it to, say, 800, while having all these columns with much bigger cumulative length will produce a scrollbar.

Trirand ASP.NET WebForms & MVC components based on jQuery & ThemeRoller

http://www.trirand.net

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

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