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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:53:23+00:00 2026-06-09T23:53:23+00:00

Is it possible to use a Dojo dgrid widget backed by an array (as

  • 0

Is it possible to use a Dojo dgrid widget backed by an array (as opposed to a datastore) with checkboxes to select rows?

I successfully started with a basic array-backed dgrid, then added the Selection mixin to enable row selection. So now I have a dgrid that is backed by an array and allows row selection. However, when I try to add checkboxes via the selector column plugin, I get an error: this.store is undefined.

I determined this.store is used to identify which rows are selected: there are several calls to the this.store.getIdentity(rowObject) method which directly correlates to results returned when querying the grid’s selection.

When using an array of objects instead of a store, is it possible specify a certain column field for identifying the selected rows? The WORKAROUND_STORE in my code below effectively does this, but perhaps I’m missing a simple solution like setting some property such as: selector({idProperty: 'col1'}). It seems like it should be easier to do.

require(["dgrid/Grid",
         "dgrid/selector",
         "dgrid/Selection",
         "dojo/_base/declare"],
    function(Grid, selector, Selection, declare){

        var columns = {
            col1: selector({}),
            col2: {label: 'COL2'},
            col3: {label: 'COL3'},
        };

        var data = [
            { col1: '1', col2: 'A', col3: 'I'},
            { col1: '2', col2: 'B', col3: 'II'},
            { col1: '3', col2: 'C', col3: 'III'}
        ];

        WORKAROUND_STORE = {
            getIdentity: function(item) { return item.col1 }
        }

        var SelectionGrid = declare([Grid, Selection]);
        window.methodGrid = new SelectionGrid({
            store: WORKAROUND_STORE,
            columns: columns,
            selectionMode: "none",
            allowSelectAll: true
        }, "methodGridDiv");
        window.methodGrid.renderArray(data);
    }
);
  • 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-09T23:53:25+00:00Added an answer on June 9, 2026 at 11:53 pm

    Here’s what I ended up doing: I wrapped my data array in a Dojo Memory store, which has a setData() method that accepts a new array of data. Main changes:

    • Use OnDemandGrid instead of Grid
    • Wrap the array of data in a Dojo Memory store object
    • Update the grid’s store to update the array of data
    • Call the grid’s refresh method()

    Full code:

    require(["dgrid/OnDemandGrid",
             "dgrid/selector",
             "dgrid/Selection",
             "dojo/_base/declare",
             "dojo/store/Memory"],
        function(OnDemandGrid, selector, Selection, declare, Memory){
    
            var columns = {
                col1: selector({}),
                col2: {label: 'COL2'},
                col3: {label: 'COL3'},
            };
    
            var data = [
                { col1: '1', col2: 'A', col3: 'I'},
                { col1: '2', col2: 'B', col3: 'II'},
                { col1: '3', col2: 'C', col3: 'III'}
            ];
    
            var SelectionGrid = declare([OnDemandGrid, Selection]);
            window.methodGrid = new SelectionGrid({
                store: Memory({idProperty: 'methodId'}),
                columns: columns,
                selectionMode: "none",
                allowSelectAll: true
            }, "methodGridDiv");
            window.methodGrid.store.setData(data);
            window.methodGrid.refresh();
        }
    );
    

    update in response to:

    Did you actually get checkboxes in there? I don’t see that in your
    code snippets.

    The code that adds checkboxes is: col1: selector({}). Or more explicitly: col1: selector({selectorType: 'checkbox'})

    Note the selector plugin is another column plugin and works differently than the editor plugin.

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

Sidebar

Related Questions

I have recently started looking into Google Charts API for possible use within the
Is it possible use mod_rewrite to resolve addresses hosted on another server? Say I
Is it possible use a MySQL query to perform this kind of check? If
I need a control having these features: It should be possible use it in
Is possible to use ArcSDE API in .NET(C#) ? http://edndoc.esri.com/arcsde/9.2/api/capi/dbconnects/dbconnects.htm Thanks
Is this possible to use Ajax.Beginform with update target inside of ajax form. like
Is it possible to use JMF in Android? JMF has good functionality? I'm basically
Is it theoretically possible to use in-app purchases to update an iOS app automatically?
is it possible to use chaplin with meteor? Any idea, advice, pointers or guidance
Is it possible to use a vector graphic as a custom form shape in

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.