Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8621259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:46:50+00:00 2026-06-12T06:46:50+00:00

I have this declaration on my script and i want to choose the columns

  • 0

I have this declaration on my script and i want to choose the columns that can see on it..

       $("#list").jqGrid({
            url: '/persons.ashx',
            datatype: 'xml',
            mtype: 'GET',
            colNames: ['Name', 'Age'],
            colModel: [
            { name: 'Name', index: 'Name', width: 100, align: 'center', editable: true, editoptions: { size: 30 }, editrules: { edithidden: false }, sortable: true },
            { name: 'Age', index: 'Age', width: 100, align: 'center', editable: true, editoptions: { size: 30 }, editrules: { edithidden: false }, sortable: true }
            ]
            ajaxSelectOptions: {
                data: {
                    codSelected: function () { return _codSelected; }
                      }
            },
            onSelectRow: function (rowid) {
               _codSelected = rowid;
            },
            autoencode: true,
            pager: '#pager',
            rowNum: 20,
            sortname: 'Name',
            sortorder: 'asc',
            sortable: true,
            autowidth: false,
            width: 999,
            height: -1,
            shrinkToFit: true,
            viewrecords: true,
            gridview: true,
            caption: 'Persons',
            editurl: ''
        });

        jQuery("#list").jqGrid('navGrid',
            '#pager',
            {
                add: false,
                del: false,
                edit: false,
                search: true,
                refresh: true,
                cloneToTop: true
            },
            { width: 360, resize: false, closeAfterEdit: true, recreateForm: true, viewPagerButtons: true
            },
            { width: 360, resize: false, closeAfterAdd: true, recreateForm: true },
            {}, //Delete action
            { closeAfterSearch: true, closeOnEscape: true }
        );
    });

        //CODE ADDDED TO CAN CHOOSE COLUMNS
        jQuery("#list").jqGrid('navButtonAdd', '#pager', {
                    caption: "",
                    buttonicon: "ui-icon-calculator",
                    title: "Choose columns",
                    onClickButton: function () {
                        $(this).jqGrid('columnChooser');
                    }
                });

I have 14 columns, but i cant see all in my screen, i have put only 2 columns in this example, but i cant see the choose button near reload button, and in fact, cant choose any column to order it..

Can anyone help me?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:46:51+00:00Added an answer on June 12, 2026 at 6:46 am

    The code which you posted has some syntax problems. It looks like

        $("#list").jqGrid({
            ...
        });
        jQuery("#list").jqGrid('navGrid', ...
        );
    });
        jQuery("#list").jqGrid('navButtonAdd', '#pager', { ...
        });
    

    I suppose it looks like

    $(function () {
        $("#list").jqGrid({
            ...
        });
        jQuery("#list").jqGrid('navGrid', ...
        );
    });
        jQuery("#list").jqGrid('navButtonAdd', '#pager', { ...
        });
    

    and you try to use navButtonAdd out of $(document).ready(...).

    If it’s really so, you should move call of navButtonAdd inside of $(document).ready(...) directly after the call of navGrid and the problem will be solved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this nice slider script that I want to use on this
If I have this float array declaration: float tables[10]; How can I change the
I have a function B that has this declaration: public void B(Class<? extends C>
It seems I can't easily have an XSD declaration for this simple XML <root>
I have a script that I want to be injected into the document BEFORE
I have a Perl script that is getting big, so I want to break
I would like to have declaration like this: void Date::get_days_name(const Date& = this) which
I have this string 2012-06-27 16:17:06 and I want to convert it to GMT
I have this jquery for my menu buttons, what I want is to get
How can I define a global javascript variable in this situation? I want the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.