|
POST
|
Hello Robert. It seems if you perform a query on the table, it overrides the custom stylesheets and change the AT header color back to default. THis video shows that not only the custom css is removed but when you click on another header, it refreshes the map which is not the intention. event.preventDefault() didn't do the trip.
... View more
03-13-2019
01:59 PM
|
0
|
7
|
2033
|
|
POST
|
Thank you Robert. My second part is to change the color of a selected column without clicking on the header. I have a dropdown box with the column names and selecting one of them, it should change the color. I'd like to avoid clicking on the header because everytime you click on a column header, it refreshes the map.
... View more
03-12-2019
10:12 AM
|
0
|
3
|
2033
|
|
POST
|
I am looking to change the color of the header by directly click on the header and also if column is selected through a click on a list of fields.. For the first task I tried css: .jimu-widget-attributetable .dgrid-header .dgrid-selected {
background-color: rgb(34, 228, 34)
} but it doesn't seem to be working.
... View more
03-11-2019
12:10 PM
|
0
|
15
|
2987
|
|
POST
|
Is there way to prgrammatically to prevent the map refreshing when you click on a header? After you click on a header and you get the filtering results, I would like to keep these results displayed after you click on another column header. I try the stop progragation but the headerclick still refreshes the map.
... View more
03-07-2019
09:49 AM
|
0
|
1
|
2569
|
|
POST
|
Thank you Robert. This is very close of what I am trying to accomplish. Didn't realized that it was under the onFilterMenuItemClick function. In the definition of the textbox.I set it as disabled, so user will need to click on the header of column before they can specify filter string in the textbox. The reason why I wanted to use the activeTable function, is because the filtering of a column could be followed by another filter on another column. So I assume that the activeTable has the resultant features on the table (after a filter operation) and you can filter on those features. The code you provide works great (I committed the sin of not thinking about the lang.hitch) for applying a filter on a single column. UPDATE: I just realized the answer was just glaring at me. Add to the expr. and it's done.
... View more
03-04-2019
09:28 AM
|
0
|
0
|
2569
|
|
POST
|
Understood. I cannot get the activeTable.refresh working. I am trying to filter the clicked column based on text entered in textbox. The script is in in _FeatureTable.js which is under the AT/table folder. _onHeaderClick: function (evt) {
var cell = this.grid.cell(evt);
var column = cell.column;
console.log(column)
filter_name = column.field
-----
----- registry.byId(this.thetextbox.id).on("change", function (value) {
console.log(value.length)
// console.log(userVal)
var query = new Query();
if (value.length >= 3) {
this.wManager = WidgetManager.getInstance();
var attWidget = this.wManager.getWidgetsByName('AttributeTable');
var partsObj = {
"expr": filter_name + " LIKE '%" + value + "%'",
"parts": []
};
var activeTable = attWidget[0]._activeTable;
activeTable.setFilterObj(partsObj);
activeTable.refresh();
}
... View more
03-01-2019
03:11 PM
|
0
|
4
|
2569
|
|
POST
|
ok. Got it. At the risk to be an idiotic question here is: I am modifying the _FeatureTable.js which is under the AT/table folder. The code presented here is to call the attWidget._activeTable; where attWidget is AT widget. In the _FeatureTable.js how to get access to the _activeTable function which in the widget.js? Do I need to re-create the _activeTable in the current file?
... View more
03-01-2019
11:31 AM
|
0
|
6
|
2569
|
|
POST
|
THank you Robert. However, I was referring to the query and not the solution for initializing the AT. But based on your response this: if(attWidget){
this.wManager.openWidget(attWidget);
var partsObj = {
"expr": "Crime_Type='Auto Theft'",
"parts": []
};
console.info(attWidget);
var activeTable = attWidget._tableFunctionController.getActiveTable();
activeTable.setFilterObj(partsObj);
activeTable.refresh(); needs to be modified to this, line 7? if(attWidget){
this.wManager.openWidget(attWidget);
var partsObj = {
"expr": "Crime_Type='Auto Theft'",
"parts": []
};
var activeTable = attWidget._activeTable.active();??
activeTable.setFilterObj(partsObj);
activeTable.refresh();
... View more
03-01-2019
10:25 AM
|
0
|
8
|
2569
|
|
POST
|
Hello Robert. It seems that this solution cannot implemented with the latest WAB since tableFunctionController is no longer available. Do you have any alternative way?
... View more
03-01-2019
09:49 AM
|
0
|
10
|
4003
|
|
BLOG
|
In case you want to exclude a layer not to show up, on the LayerList then you probably don't want it appear in the Legend and Attribute Table either. LayerList Widget The LayerList widget through the Settings provides a way to exclude layers to be listed in the Layer List. However, if you add a layer programmatically, the layer is not listed in the Settings. You can exclude a layer by accessing the LayerListView.js under the LayerList widget folder under the addLayerNode function and add this simple script. In this script, a layer with the text "Outside" in the title of the layer will be excluded. You can use any other layerinfo property to specify which layer to exclude. Under the the LayerListView.js drawListNode: function(layerInfo, level, toTableNode, position) {
var nodeAndSubNode, showLegendDiv;
if(this.isLayerHiddenInWidget(layerInfo) || layerInfo.title.includes("Outside")) {
return;
}
---------------------
--------------------- Attribute Table Widget Under the widget.js there are two places to modify the script. Under the initDiv function (add line 8 and line 12) -------------
-------------
paneJson.paneId = json.id;
paneJson.title = json.name;
paneJson.name = json.name;
paneJson.layerType = this._layerTypes.FEATURELAYER;
paneJson.style = "height: 100%; width: 100%; overflow: visible;";
if (!paneJson.name.includes("Outside")) {
var cp = new ContentPane(paneJson);
this.layerTabPages[j] = cp;
this.tabContainer.addChild(cp);
}
}
}
----------------
---------------- Under the onReceiveData function add lines 6 and 26 -------------------------
-------------------------
params.layer = params.layer || params.layerInfo;
console.log(params)
if (!params.layer.title.includes("Outside")) {
if (!this.showing) {
this._openTable().then(lang.hitch(this, function () {
var isInResources = !!this._resourceManager.getLayerInfoById(params.layer.id);
if (!isInResources) {
this._resourceManager.updateLayerInfoResources(false)
.then(lang.hitch(this, function () {
this._addLayerToTable(params);
}));
} else {
this._addLayerToTable(params);
}
}));
} else {
this._resourceManager.updateLayerInfoResources(false)
.then(lang.hitch(this, function () {
this._addLayerToTable(params);
}));
}
}
}
----------------------------
-------------------------- Legend Widget Thanks to Robert Scheitlin's solution at: How to remove a layer from the Legend widget in Developer Addition Web App Builder? We are programmatically adding a Grid layer to the map using JavaScript API, not the Web Map, and would like to hide the layer from the Legend Widget when we add this lay I was able to remove from Legend widget as well with a slight modification, probably because it is a different WAB version and the widget code has been modified. Added lines 14-21 and comment out line 23. The other lines were already comment out by ESRI. I am using WAB version 2.8. _getLayerInfosParam: function() {
var layerInfosParam;
/*
if(this.config.legend.layerInfos === undefined) {
// widget has not been configed.
layerInfosParam = legendUtils.getLayerInfosParam();
} else {
// widget has been configed, respect config.
layerInfosParam = legendUtils.getLayerInfosParamByConfig(this.config.legend);
}
*/
layerInfosParam = legendUtils.getLayerInfosParam(this.config);
filteredLayerInfosParam = layerInfosParam.filter(function(layerInfoParam) {
if(!layerInfoParam.title.includes("Outside")){
console.log(layerInfoParam)
return layerInfoParam;
}
});
return filteredLayerInfosParam;
//return layerInfosParam;
},
... View more
02-20-2019
05:22 PM
|
2
|
0
|
2113
|
|
DOC
|
This widget enables the users to use the Google Tools in a way that does not violate Google's Terms of Use (TOS). Thiis is the workflow: When a user clicks on a location on the ArcGIS map, this widget will copy the XY coordinates of the clicked point. So, in the widget.js there is this line: var url1= "http://xxxxx/google_tools/index.html?lat=" You will need to have access to a web server where you will post this index.html file. So, if your web server url is at http://myserver change the above code to reflect the connection to your server. var url1= "http://myserver/google_tools/index.html?lat=" The widget will formulate the url1 and call the index file on your webserver. Click here to get the index.html file, so you can use it and place it in your webserver. The index.html file will open as a Google map, centered at the point you clicked on on your app. That's it. Here is a demo.
... View more
02-14-2019
08:53 AM
|
0
|
19
|
9766
|
|
DOC
|
As I mentioned on this posting https://community.esri.com/message/831602-re-can-someone-send-me-the-script-files-for-one-of-their-old-web-appbuilder-ap… the index.html file is Google Maps page. It will open google maps at the location that user clicked on the ESRI map. For this page to be functional, it will need the Google API key. On this page you will be presented the option to view Streetview or GE. the ndex page is called on line #42 of the widget.js of the https://community.esri.com/docs/DOC-13056-googletoolszip
... View more
02-14-2019
08:35 AM
|
0
|
0
|
1930
|
|
POST
|
I changed the workflow, and hopefully it complies with Google's TOS. It is not straight forward process but that's the price to pay to get access to the Google tools. By using the the Google Tools (https://community.esri.com/docs/DOC-13056-googletoolszip ) widget, user clicks on the map where he/she wants to view Streetview or GE. The click will call the Google Maps window (index.html ) and pass on the coords of the location. The google maps window will open with an infowindow to select streetview or GE. So, in addition to the widget, you will need to post the index.html on your IIS and insert your Google API key to work. You can get a developer's Google Map API key at: Get API Key | Maps JavaScript API | Google Developers
... View more
02-13-2019
03:01 PM
|
2
|
4
|
4175
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 1 | a month ago | |
| 1 | 06-19-2025 10:13 PM | |
| 3 | 02-06-2026 10:44 AM | |
| 1 | 01-08-2026 12:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|