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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:36:46+00:00 2026-06-11T23:36:46+00:00

I am trying to create a grid builder object. This grid builder has a

  • 0

I am trying to create a grid builder object. This grid builder has a method, buildGrid, which I’ve designed to expect an object defining a bunch of paramaters for a grid:

buildOrdersGrid: function () {
    var ordersGrid = buildGrid({
        gridElementID: 'OrdersGrid',
        gridPagerElementID: 'OrdersGridPager',
        colNames: ['Order ID', 'Project Subcode', 'Incident Number', 'Cost Center', 'Name', 'Customer'],
        colModel: [
            { name: 'ID', hidden: true },
            { name: 'ProjectSubcode' },
            { name: 'IncidentNumber' },
            { name: 'CostCenter' },
            { name: 'Name' },
            { name: 'Customer' }
        ],
        defaultCaption:'Orders: no filter applied',
    });
    return ordersGrid;
}

function buildGrid(data) {
    var grid = $('#' + data.gridElementID);
    var gridPager = $('#' + data.gridPagerElementID);

    grid.jqGrid({
        datatype: 'local',
        colNames: data.colNames,
        colModel: data.colModel,
        gridview: true,
        height: 'auto',
        pager: gridPager,
        viewrecords: true,
        multiselect: true,
        defaultCaption: data.defaultCaption,
        caption: data.defaultCaption,
        shrinkToFit: false
    });

    return grid;
}

Something like that, but it’s really new code, so open to advice on how to improve.

Now, I would like to extend this buildGrid method such that it can take non-predefined properties and give them to the jqGrid. Something like:

buildTaskGrid: function () {
    var tasksGrid = buildGrid({
        gridElementID: 'TasksGrid',
        gridPagerElementID: 'TasksGridPager',
        colNames: ['Order', 'Task ID', 'Task #', 'Type', 'Status', 'Assignee', 'Current Location', 'Dest Location', 'Change No', 'Net Patched', 'SAN Patched'],
        colModel: [
            { name: 'Order' },
            { name: 'TaskID', hidden: true },
            { name: 'TaskNo' },
            { name: 'Type' },
            { name: 'Status' },
            { name: 'Assignee' },
            { name: 'CurrentLocation' },
            { name: 'DestLocation' },
            { name: 'ChangeNo' },
            { name: 'NetPatched' },
            { name: 'SANPatched' }
        ],
        defaultCaption:'Tasks: no filter applied',
        //Decorate with task-specific properties.
        grouping: true,
        groupingView: {
            groupField: ['Order'],
            groupColumnShow: [false]
        },
        ondblClickRow: function (rowid) {
            $(this).trigger('taskDoubleClicked', selector.getRowData(rowid));
        } 
    });

    return tasksGrid;
}

I’m not sure how I should best ‘find’ the unanticipated properties and give them to the grid. Any ideas?

  • 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-11T23:36:47+00:00Added an answer on June 11, 2026 at 11:36 pm

    I think you can use this http://api.jquery.com/jQuery.extend/

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

Sidebar

Related Questions

I am currently trying to create a sudoku grid in javascript, to do this
I have to do a grid like this: Harmonic table I'm trying to create
Im trying to create a mixing for Ext.grid.Panel components. This is how I have
I am trying to create a grid UIScrollView , which so far is working
I'm trying to create a grid that has a store with a PagingMemoryProxy in
I am trying to create a grid of thumbnails in wordpress, which I've managed
I'm trying to create this grid: I've made some html generated with jQuery and
I am trying to create an Ajax Telerik grid in Razor that has an
I am trying to create a grid like system with div's with content floated
I'm trying to create a dynamic grid using ExtJS. The grid is built and

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.