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
Grid Header and Content Alignment
02/03/2010
22:54
Avatar
johntom
nyc
Member
Members
Forum Posts: 4
Member Since:
02/03/2010
sp_UserOfflineSmall Offline

Hi,

Fairly new to jqGrid and consider my testing quite successful. I have 1 probelm that I've searched and changed most possible settings and still can't get the headers to allign with data.

Asp.net 3.5 MVC (VS 2008)

Entity Framework using Firebird database

Jquery: 1.4.2

JqueryUI: 1.8.rc3

jqgrid 3.6.4

GridDemo.Home.GridDemo = {

    setupGrid: function(grid, pager, search) {
   grid.jqGrid({
            datatype: 'json',
            mtype: 'GET',
            width:850,{or autowidth:true}
           
            shrinkToFit: false,
            colNames: ['Art ID', 'Title', 'Category','CatDesc', 'Date', 'Ref'],
            colModel: [
     { name: 'ARTICLE_ID', index: 'ARTICLE_ID', width: 150, search: true, editable: true, editoptions: { readonly: true, size: 10} },
     { name: 'ARTICLE_TITLE', index: 'ARTICLE_TITLE', width: 150, search: true, sortable: true, editable: true, edittype: 'text', editoptions: { size: 100, maxlength: 100} },
     { name: 'CATEGORY_ID', index: 'CATEGORY_ID', width: 150, hidden: false, editable: true, jsonmap: "CAT_DESC", edittype: 'select',
         editoptions: { value: calcMethodSelect(), editrules: { required: true },

             dataEvents: [{
                 type: 'change', fn: function(e) {
                     var thisval = $(e.target).val();
                     $("#targetsel").html(targetSelect(thisval))
                 } }]
             }
         },
   { name: 'CAT_DESC', index: 'CAT_DESC', search: false, editable: false, hidden:true},
   
      { name: 'DATE_ADD', index: 'DATE_ADD', width: 150, editable: true },
        { name: 'REF', index: 'REF', width: 150, editable: false, sortable: false }
            ],
            pager: pager,
            sortname: 'ARTICLE_ID',
            rowNum: 10,
            rowList: [10, 20, 50],
            sortorder: "asc",
            url: "GridDemoData",
            viewrecords: true,
            ondblClickRow: ShowArticleDetails,
            editurl: "GridSave",

            caption: 'Articles from 2008'
        }).navGrid("#pager", { edit: true, add: false, del: false, search: true },
        {
            modal: true,
            width: 450,
            height: 'auto',  
            reloadAfterSubmit: false, closeAfterEdit: true,
            closeAfterAdd: false,
            onInitializeForm: function(formid) {
                jQuery("#DATE_ADD", formid).datepicker({ showOn: 'focus' });
});
            }
        });

        search.filterGrid("#" + grid.attr("id"), {
            gridModel: false,
            filterModel: [{
                label: 'Search',
                name: 'search',
                stype: 'text'}]
            });
        }
    };

=====

Site.Master

   <link href="<%= Url.Content("../../css/ui-lightness/jquery-ui-1.8rc3.custom.css") %>" rel="stylesheet"   type="text/css" />
   <link href="<%= Url.Content("../../js/src/css/ui.jqgrid.css") %>" rel="stylesheet"   type="text/css"/>
   <link href="<%= Url.Content("../../js/src/css/jquery.searchFilter.css") %>" rel="stylesheet"   type="text/css" />

...

    <script src="../../js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="../../js/jquery.jqGrid.min.js" type="text/javascript"></script>
 
    <script src="<%= this.ResolveClientUrl("../../Scripts/jquery-ui-1.8rc3.custom.min.js") %>" type="text/javascript"></script>
    <script src="<%= this.ResolveClientUrl("../../js/i18n/grid.locale-en.js") %>" type="text/javascript"></script/-->
    <script src="../../js/src/grid.loader.js" type="text/javascript"></script>

Thanks,

John[Image Can Not Be Found]

05/03/2010
13:00
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

This is not done automatically from the grid. For this purpose you should use setLabel method.

Suppose you want to align some header column to right you should

$("#mygrid").jqGrid("setLabel","mycolname","",{"text-align":"right"});

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.

05/03/2010
21:03
Avatar
johntom
nyc
Member
Members
Forum Posts: 4
Member Since:
02/03/2010
sp_UserOfflineSmall Offline

Hi Tony,

Perhaps I didn't explain my problem clearly. Here's a jpg.

Thanks again for your fantastic product,

Jjqgrid header alingnmentImage Enlargerohn

05/03/2010
21:12
Avatar
johntom
nyc
Member
Members
Forum Posts: 4
Member Since:
02/03/2010
sp_UserOfflineSmall Offline

Do over!

headerImage Enlarger

09/03/2010
19:40
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Somthing is not correct here. Are you sure if this is the whole code?

It seems like the first row is with missed width.

Please do not try to use any events - just pure grid with data and see the result.

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.

10/03/2010
02:25
Avatar
johntom
nyc
Member
Members
Forum Posts: 4
Member Since:
02/03/2010
sp_UserOfflineSmall Offline

Hi Tony,

After some more testing it appears that nothing is wrong with the grid nor my scripts. Apparently the October theme from http://www.asp.net/mvc/gallery.....rtsjs=true causes the problem. I've tried a few others and they all worked fine. Its the site.css file copied to the content folder that causes the problem.

Thanks,

John

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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