Select to view content in your preferred language

Find Task and DataGrid Questions

852
4
06-24-2011 11:09 AM
KevinLaughlin
Occasional Contributor
Hello,

I have a javascript web app, and it works fine. Being a newbie, I have a few questions as to how to expand some of the functionality.

First, how would one go about flashing one of the found polygons in a datagrid, similar to the functionality you have when performing a find in ArcGIS.

Secondly, I have another point layer that I'd like to perform finds on, how do I go about adding that second layer to find find function.

I'll post my app for a little more clarity.



Thanks in advance


Kevin L.
0 Kudos
4 Replies
HemingZhu
Frequent Contributor
Hello,

I have a javascript web app, and it works fine. Being a newbie, I have a few questions as to how to expand some of the functionality.

First, how would one go about flashing one of the found polygons in a datagrid, similar to the functionality you have when performing a find in ArcGIS.

Secondly, I have another point layer that I'd like to perform finds on, how do I go about adding that second layer to find find function.

I'll post my app for a little more clarity.



Thanks in advance


Kevin L.


For your first question. This is how i did (code snippet);

//editedId is the OBJECTID of selected feature on the map
      for (var i = 0; i < grid.rowCount; i++) {
                    item = grid.getItem(i);   //item = grid._by_idx.item;
                    if (editedId == item.OBJECTID) {
                        grid.selection.clear();
                        grid.selection.setSelected(i, true) //grid.focus.setFocusIndex(i, 0); //grid.selectedIndex = i;
                        editedId = 0;
                    }
For you seconde question. If your second layer is in the same map service of your first layer, you could include it by findParams.layerIds = [firstLayerID, SecondLayerID]; if If your second layer is not in the same map service of your first layer, you most likely have to do find tasks seperately.
                }                    }
0 Kudos
KevinLaughlin
Occasional Contributor
Thanks for replying!

As for the second question, I did that, but it doesn't show up when you click search. I've added another variable called marker symbol (because I'm now searching off of a point FC), but to no avail.

It might have something to do with the new layer not being connected to the DataGrid, but I'm not sure.


Kevin
0 Kudos
HemingZhu
Frequent Contributor
Thanks for replying!

As for the second question, I did that, but it doesn't show up when you click search. I've added another variable called marker symbol (because I'm now searching off of a point FC), but to no avail.

It might have something to do with the new layer not being connected to the DataGrid, but I'm not sure.


Kevin


Don't specify FindParameters searchFields and run your code to see if you get any find results back from the second layer.
0 Kudos
KevinLaughlin
Occasional Contributor
Sorry for the late reply, I've been caught up in some other things here at work.

I've tried that and unfortunately it did not work.
0 Kudos