POST
|
I know you are looking for an ArcObjects solution but I wanted to mention this approach. 1) Create a new empty geodatabase 2) In ArcCatalog connect to the source database and select everything except the tables you want to delete. 3) Paste your selection into the new database. This approach will get you a new database without the tables you wanted removed.
... View more
08-16-2017
08:42 PM
|
0
|
0
|
952
|
POST
|
So this is what I ended up doing that resolved this issue for me. Instead of using a row context menu event I changed to a row mousedown event. Then I checked if the mouse down was the right button and added my code inside that block. This works as expected. Note that now that you build a new context menu every time you right click on a row, you may want to destroy the previous menu before creating a new one. What I am doing is keeping the previous menu if it does not change, and destroying previous if I need to create a new one (theMenu.destroyRecursive()). grid.on(".dgrid-row:mousedown, mouseDownCallback); mouseDownCallback: function(evt) { var row = grid.row(evt); if (mouse.isRight(evt)) { //here build your context menu depending on the content of row, for example the following will show a context menu //with one item which when clicked will popup an alert box with the content of the row's name property value: var theMenu = new Menu({targetNodeIds: [grid.domNode], selector: ".dgrid-row"}); theMenu.addChild(new MenuItem({label: row.name, onClick: function(evt){alert('name: ', row.name)}); } }
... View more
05-17-2017
07:46 AM
|
0
|
0
|
533
|
POST
|
Here is a link that shows the issue: JS Bin - Collaborative JavaScript Debugging When you right click A nothing happens, right click A a second time and the menu appears. OR right click A and then right click B and the menu appears with A's content. I'm simply trying to get the context menu to appear the first time and be specific to the selected row. You right click A you get A's context menu, you right click B you get B's context menu. And always on the first click. Hello, I'm trying to make the dijit menu's menuitems custom to the item selected in a dgrid row. Right now the menuitems aren't refreshing when the row changes. For example if the first row I click on is "C" I get: First, C1, C2, Last - correct! If I then right click on row B I get the same thing as above for C. BUT!, If I then click back onto row C I get: First, B, Last - incorrect - This is what should have been displayed on the B row click just above. If I then re-click on row C the menu items are correct. Or if I were to right click twice on any row the second menu items list is correct. I'm trying to customize the menu items to the row being selected. How can I "refresh", "clear", "reset" whatever so that the menuitems will be specific to the row being selected? Also, I'm having a problem where I have to right click twice in order to display the context menu. I think it has something to do with my "targetNodeIds" - var pmenu = new Menu({ targetNodeIds: [thisRoot.grid.domNode] }); "thisRoot" is the "window.this", the dgrid scope this. this.grid.on('.dgrid-row:contextmenu', function (evt) { evt.preventDefault(); if (selectedRow != null && selectedRow.XObject1 != null) { var pmenu = new Menu({ targetNodeIds: [thisRoot.grid.domNode] }); pmenu.addChild(new MenuItem({ label: "AlwaysFirstItemInTheList", iconClass: "FIRST", onClick: function () { contextFunc(this.id, selectedRow); } })); switch (selectedRow.XObject1.XTypeTable) { case "A": break; case "B": pmenu.addChild(new MenuItem({ label: "B", iconClass: "B", onClick: function () { contextFunc(this.id, selectedRow); } })); break; case "C": pmenu.addChild(new MenuItem({ label: "C1", iconClass: "C", onClick: function () { contextFunc(this.id, selectedRow); } })); pmenu.addChild(new MenuItem({ label: "C2", iconClass: "C", onClick: function () { contextFunc(this.id, selectedRow); } })); break; } pmenu.addChild(new MenuItem({ label: "AlwaysLastItemInTheList", onClick: function () { contextFunc(this.id, selectedRow); } })); pmenu.startup();
... View more
04-24-2017
10:40 AM
|
0
|
2
|
1680
|
POST
|
Ken, Thank you for the response. Boy what a pain that option is. I'm having issues setting the levelOrFactor value. I tried 1 (one) and it zooms out to the entire background layer. I finally tried 20 (twenty) and it is at an acceptable level. Is there a "pan" option? Something that might keep the scale at the same scale the user is currently at and just move to the selected feature?
... View more
04-21-2017
03:55 PM
|
0
|
1
|
470
|
POST
|
Hello, I'm using WAB 2.2 and the Jewelry Box Theme. I'm trying to select a feature on the map and zoom to it. I would think there would be examples of this but they sure are hard to find. queryTask = new QueryTask(MyFeatureLayer); query = new Query(); query.where = myWhereClause; query.returnGeometry = true; query.outSpatialReference = this.map.spatialReference; queryTask.execute(query, function (results) { var geo = results.features[0].geometry; this.map.setExtent(geo.getExtent(),true); }); I'm attempting to select a single point in a point feature layer and zoom to that feature. TypeError: Cannot read property 'toJson' of null at Object.setExtent (init.js:593)
... View more
04-21-2017
12:44 PM
|
0
|
3
|
1295
|
POST
|
Robert, Interesting, there is a FeatureAction that calls the queryRouteDetails. But queryRouteDetails is inside the widget.js, not in the feature action itself. I will look into passing the shelter as an object to queryRouteDetails. Greg
... View more
04-17-2017
10:14 AM
|
0
|
0
|
120
|
POST
|
Robert, I have removed the using byId and replaced it with this.shelter.show()/hide() and I am still getting the error below. This function is called from a Feature Action. queryRouteDetails: function (XTable, XId) { switch (XTable) { case "fibermngr": this.selectedFibermngrId = XId; break; case "cable": case "span": this.selectedSpanId = XId; break; } this.cbRDName.length = 0; this.cbRDPortsStrands.length = 0; this.shelter.show(); //this is the call to the server _app.getName.call(this, { init.js:113 TypeError: this.shelter.show is not a function at Object.queryRouteDetails (Widget.js?wab_dv=2.2:213) at RouteDetailsFeatureAction.js?wab_dv=2.2:51 at h (init.js:107) at k (init.js:107) at g.resolve (init.js:109) at Object.<anonymous> (WidgetManager.js?wab_dv=2.2:634) at f.<anonymous> (init.js:63) at f.c [as onwidgetCreated] (init.js:119) at Function.h.emit (init.js:124) at Function.h.emit (init.js:125) "TypeError: this.shelter.show is not a function at Object.queryRouteDetails (http://esritest.esri.ospinsight.com:3344/webappbuilder/apps/2/widgets/RouteDetails/Widget.js?wab_dv=2.2:213:24) at http://esritest.esri.ospinsight.com:3344/webappbuilder/apps/2/widgets/RouteDetails/RouteDetailsFeatureAction.js?wab_dv=2.2:51:20 at h (http://js.arcgis.com/3.18/init.js:107:279) at k (http://js.arcgis.com/3.18/init.js:107:205) at g.resolve (http://js.arcgis.com/3.18/init.js:109:280) at Object.<anonymous> (http://esritest.esri.ospinsight.com:3344/webappbuilder/apps/2/jimu.js/WidgetManager.js?wab_dv=2.2:634:21) at f.<anonymous> (http://js.arcgis.com/3.18/init.js:63:209) at f.c [as onwidgetCreated] (http://js.arcgis.com/3.18/init.js:119:79) at Function.h.emit (http://js.arcgis.com/3.18/init.js:124:331) at Function.h.emit (http://js.arcgis.com/3.18/init.js:125:443) ---------------------------------------- rejected at a (http://js.arcgis.com/3.18/init.js:108:174) at h (http://js.arcgis.com/3.18/init.js:107:438) at k (http://js.arcgis.com/3.18/init.js:107:205) at g.resolve (http://js.arcgis.com/3.18/init.js:109:280) at Object.<anonymous> (http://esritest.esri.ospinsight.com:3344/webappbuilder/apps/2/jimu.js/WidgetManager.js?wab_dv=2.2:634:21) at f.<anonymous> (http://js.arcgis.com/3.18/init.js:63:209) at f.c [as onwidgetCreated] (http://js.arcgis.com/3.18/init.js:119:79) at Function.h.emit (http://js.arcgis.com/3.18/init.js:124:331) at Function.h.emit (http://js.arcgis.com/3.18/init.js:125:443) at f.emit (http://js.arcgis.com/3.18/init.js:117:218) ---------------------------------------- Error at g.then.c.then (http://js.arcgis.com/3.18/init.js:110:97) at Object.onExecute (http://esritest.esri.ospinsight.com:3344/webappbuilder/apps/2/widgets/RouteDetails/RouteDetailsFeatureAction.js?wab_dv=2.2:32:8) at Object._clickHandler (http://esritest.esri.ospinsight.com:3344/webappbuilder/apps/2/jimu.js/dijit/PopupMenuItem.js?wab_dv=2.2:90:21) at HTMLDivElement.<anonymous> (http://js.arcgis.com/3.18/init.js:63:209)"
... View more
04-17-2017
09:05 AM
|
0
|
1
|
655
|
POST
|
Robert, You are correct, the array has a zero length. So how do I get this to work? How do I make it "wait" for the selection to complete to activate the zoom to portion of the code? Greg
... View more
04-17-2017
08:47 AM
|
0
|
2
|
321
|
POST
|
Robert, var geom = selMgr.getUnionGeometryBySelectedFeatures(mylayer); So, now geom is null. selMgr is valid, myLayer is valid. Should I be looking at a specific value of mylayer to get the extent of all the selected features? Greg
... View more
04-14-2017
10:14 PM
|
0
|
1
|
984
|
POST
|
Robert, Even when shelter is defined as a global variable using getElementById? Line 61 var shelter = document.getElementById("busycur"); And I added "busycur" as the id in the html statement. I did that because this.shelter.show() was throwing the error previously mentioned. Greg
... View more
04-14-2017
09:31 PM
|
0
|
1
|
655
|
POST
|
Robert, Okay, thanks, I found the help on SelectionManager. But there is no information on getUnionGeometryBySelectedFeatures, where can I find help on that method? Am I supposed to return something that is used to set the extent? I have this now: var selMgr = SelectionMgr.getInstance(); var mylayer = this.map.webMapResponse.itemInfo.itemData.operationalLayers[3].layerObject; selMgr .getUnionGeometryBySelectedFeatures(mylayer); this.map.spatialReference = selMgr ; No errors, but it doesn't zoom to the selected features. I checked and mylayer is a feature layer and is the correct one. I also looked and selMgr does have an array of objects Greg
... View more
04-14-2017
04:39 PM
|
0
|
1
|
984
|
POST
|
Robert, Yes, I'm inside a custom widget. It has just done it's job and selected features on the map. I'd now like to zoom to those features. I added jimu/SelectionManager to the define and function. I then set it up like this: var mylayer = this.map.webMapResponse.itemInfo.itemData.operationalLayers[3].layerObject; var sm = SelectionMgr.getUnionGeometryBySelectedFeatures(mylayer); this.map.spatialReference = sm; And I get the following error: TypeError: SelectionMgr.getUnionGeometryBySelectedFeatures is not a function
... View more
04-14-2017
02:40 PM
|
0
|
1
|
984
|
POST
|
Yes, added the define and the function ref. Then inside my event I added this.shelter.show(); I even tried setting a global variable to "busycur" and that was null. Here is my html <div> <div id="osproutedetails"> <select id="cbRdType" data-dojo-attach-point="cbRDType" style="width:100px" data-dojo-attach-event="onchange:cbRdType_Changed"> <option value="Term. Points" selected="selected">Term. Points</option> <option value="Equipment">Equipment</option> <option value="Cable Spans">Cable Spans</option> </select> <select id="cbRDName" data-dojo-attach-point="cbRDName" style="width:150px" data-dojo-attach-event="onchange:cbRdName_Changed"> </select> <select id="cbRDPortsStrands" data-dojo-attach-point="cbRDPortsStrands" style="width:150px" data-dojo-attach-event="onchange:cbRDPortsStrands_Changed"> </select> <input id="RDPatchStop" type="checkbox" name="chkStopAtPatch" value="Stopatpatch"> Stop at patch <input id="RDShowEndsOnly" type="checkbox" name="chkShowEndsOnly" value="showendsonly"> Show Ends Only <button id="BtnClearGraphics" data-dojo-attach-point="BtnClearGraphics" data-dojo-type="dijit/form/Button" data-dojo-attach-event="onclick:_onBtnClearGraphicsClicked">Remove Flags</button> <!--<input type="checkbox" name="chkShowRunTime" value="Showruntime">Show run time <button name="btnOptions">Options...</button> <button name="btnExport">Export</button>--> </div> <h4></h4> <div data-dojo-attach-point="dGridContainerNode"></div> <div id="busycur" data-dojo-type="jimu/dijit/LoadingShelter" data-dojo-attach-point="shelter" data-dojo-props="hidden:true" style="overflow:hidden;"></div> </div>
... View more
04-14-2017
02:16 PM
|
0
|
1
|
655
|
POST
|
Robert, Thank you for the reply. Yes that would work for me. I just want something to show that the widget is processing the request. Depending on what the user has selected it can take time to get a response back from the server. I added the code you indicated above but I get an error - TypeError: this.shelter.show is not a function. I'm trying to call it at specific locations within my widget just prior to a server call. I don't want it called when the widget loads because often the user needs to interact with the widget in some way to generate the server call. For example clicking on a button or changing an option dialog.
... View more
04-14-2017
01:35 PM
|
0
|
1
|
655
|
Title | Kudos | Posted |
---|---|---|
2 | 12-19-2016 11:36 AM | |
2 | 03-14-2017 04:17 PM | |
1 | 12-02-2016 09:50 AM | |
2 | 10-20-2016 03:10 PM | |
1 | 10-07-2016 04:23 PM |
Online Status |
Offline
|
Date Last Visited |
09-29-2021
09:14 PM
|