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 9210209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:01:04+00:00 2026-06-18T01:01:04+00:00

I am a beginner in the jQgrid, Last days i try to learn jQgrid

  • 0

I am a beginner in the jQgrid, Last days i try to learn jQgrid and create a sample

Mvc application. refer on jQgrid Website. http://www.trirand.com/blog/jqgrid/jqgrid.html

I try to make a Grid as Subgrid in jQGrid. I want Add, Edit, Delete functions in all

child grid is possible.

and i am facing a problem when i expand a row in the jQgrid, parent row is not showing

the collapse icon. Please see my image below.

enter image description here

please see the Red box. It’s not showing the minus icon. Please see my code below.

  <table id="listsg11">
</table>
<div id="pagersg11">
</div>
<script type="text/javascript">
    jQuery("#listsg11").jqGrid({
        url: '/Home/DynamicGridData/',
        datatype: "json",
        mtype: 'POST',
        height: 190,
        width: 600,
        colNames: ['Id', 'Votes', 'Title'],
        colModel:
        [
            { name: 'Id', index: 'Id', width: 40, align: 'left' },
            { name: 'Votes', index: 'Votes', width: 40, align: 'left' },
            { name: 'Title', index: 'Title', width: 400, align: 'left' }
        ],
        rowNum: 8,
        rowList: [8, 10, 20, 30],
        pager: '#pagersg11',
        sortname: 'id',
        viewrecords: true,
        sortorder: "desc",
        multiselect: false,
        subGrid: true,
        caption: "Grid as Subgrid"
        ,
        subGridRowExpanded: function (subgrid_id, row_id) {
            // we pass two parameters 
            // subgrid_id is a id of the div tag created whitin a table data 
            // the id of this elemenet is a combination of the "sg_" + id of the row 
            // the row_id is the id of the row 
            // If we wan to pass additinal parameters to the url we can use 
            // a method getRowData(row_id) - which returns associative array in type name-value 
            // here we can easy construct the flowing
            var subgrid_table_id, pager_id;
            subgrid_table_id = subgrid_id + "_t";
            pager_id = "p_" + subgrid_table_id;
            $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + pager_id + "' class='scroll'></div>");
            jQuery("#" + subgrid_table_id).jqGrid({
                url: "/Home/DynamicGridData1/",
                datatype: "json",
                mtype: 'POST',
                colNames: ['Id', 'Votes', 'Title'],
                colModel:
                [
                    { name: 'Id', index: 'Id', width: 40, align: 'left' },
                    { name: 'Votes', index: 'Votes', width: 40, align: 'left' },
                    { name: 'Title', index: 'Title', width: 400, align: 'left' }
                ],
                rowNum: 20,
                rowList: [8, 10, 20, 30],
                pager: pager_id,
                sortname: 'Id',
                sortorder: "asc",
                height: 180,
                width: 500,
            });
            jQuery("#" + subgrid_table_id).jqGrid('navGrid', "#" + pager_id, { edit: true, add: true, del: true })
        }
        //,
        //            subGridRowColapsed: function (subgrid_id, row_id) {
        //                alert(row_id);
        //                // this function is called before removing the data 
        //                //var subgrid_table_id; 
        //                //subgrid_table_id = subgrid_id+"_t"; 
        //                //jQuery("#"+subgrid_table_id).remove();
        //            }
    });
    jQuery("#listsg11").jqGrid('navGrid', '#pagersg11', { add: true, edit: true, del: true });

</script>

Please help.

  • 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-18T01:01:05+00:00Added an answer on June 18, 2026 at 1:01 am

    Why you don’t try put the javascript inside of

    $(function(){
    //here go the script
    });
    

    Because one of the reasons are that the jqgrid are not correctly downloaded yet.

    So try this!

    Good Luck!

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

Sidebar

Related Questions

Beginner here See - http://www.w3schools.com/js/tryit.asp?filename=try_dom_tablerow_cells In this example, when change content is pressed, new
Python beginner here, I have a list of lists and want to refer to
(Beginner to HTML) I have made a Photoshop mock-up of the website I want
Beginner to PHP here. I'm designing a small website for an assignment with the
I am a beginner in using jQgrid with REST Web service. Please give an
total beginner to spring mvc. I need to prepopulate edit form in springmvc frame-work.
quick beginner MATLAB question. How do I create a 1 by N matrix with
(Lisp beginner) I need to create a 2D array, and initialize each cell in
Beginner iOS dev here. I have a problem in my array. Im making an
Beginner here trying to get a pipeline working in bash. If somebody can see

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.