Checking a row selects the given feature - Datagrids and checkboxes

1873
0
06-02-2011 11:09 AM
AndrewBrown1
Occasional Contributor II
Hi All,

I'm dynamically creating a dojo datagrid, specifically an enhanced grid, depending on what feature class i'm searching against in my search tool. The search results are populated in this dynamic table in a static div. I am using the indirectSelection plugin, which enables me to have checkboxes in the first column of each row.

Once the search results are populated in the table, every row in the table is automatically checked and every feature on the map is selected.

How do I tie the checkboxes to the current selection? So if I uncheck a row, it's unchecked from the map, and vice versa? I can currently uncheck a box, but the feature is still selected on the map.

Thanks!!!

Code below:

searchGrid = new dojox.grid.EnhancedGrid({
          query: {
            OBJECTID: '*'
          },
          store:store,
          clientSort:true,
          rowSelector:'20px',
          structure:fieldNameArr,
          plugins: {
            indirectSelection: true
          }
        });
        dojo.byId("searchTab").appendChild(searchGrid.domNode);
        searchGrid.startup();
        searchGrid.rowSelectCell.toggleAllSelection(true);
0 Kudos
0 Replies