POST
|
Thanks for the input -- I change TabContainer to TabContainer3 but don't see that it has any removeTab or remove method (probably not implementing correctly tho: this.selTab = 'Water Use';
this.tabContainer = new TabContainer3({
tabs: tabs,
selected: this.selTab
}, this.tabIdentify);
this.tabContainer.startup();
for (var i = 0; i < this.tabContainer.tabs.length; i++) {
if (this.tabContainer.tabs[i].title == 'Water Use'){
this.tabContainer.tabs[i].removeTab();
//this.tabContainer.tabs[i].style.display ='none' //error: Cannot set properties of undefined (setting 'display')
}
}
... View more
01-09-2023
07:12 AM
|
0
|
2
|
689
|
POST
|
WAB 2.19 JS 3.x Inherited a custom widget that has TabContainer implemented and attempting to hide tabs by title. Removing the TabContainer altogether isn't an option as there is a ton of js that would have to be reworked and prefer to just have a simple loop to hide elements. I'm able to setup a loop over the tabs and successfully evaluate on title but not able to apply the correct method to hide the tab. _initTabContainer: function() {
var tabs = [];
tabs.push({
title: 'Water Use',
content: this.tabNode1
});
tabs.push({
title: 'ERP',
content: this.tabNode2
});
tabs.push({
title: 'OKEE',
content: this.tabNode3
});
tabs.push({
title: 'ERC',
content: this.tabNode4
});
this.selTab = 'ERP';
this.tabContainer = new TabContainer({
tabs: tabs,
selected: this.selTab
}, this.tabIdentify);
this.tabContainer.startup();
//this is where I'm attempting to hide tabs
for (var i = 0; i < this.tabContainer.tabs.length; i++) {
if (this.tabContainer.tabs[i].title == 'Water Use'){
this.tabContainer.tabs[i].style.display ='none' //error: Cannot set properties of undefined (setting 'display')
}
}
this.own(on(this.tabContainer, 'tabChanged', lang.hitch(this, function (title) {
if (title == 'ERP') {
this.currentTab = 'ERP'}
else if (title == 'Water Use'){
this.currentTab = 'WU'
}
else if (title == 'OKEE'){
this.currentTab = 'OKEE'
}
else if (title == 'ERC') {
this.currentTab = 'ERC'
}
})));
utils.setVerticalCenter(this.tabContainer.domNode);
},
... View more
01-09-2023
06:22 AM
|
0
|
4
|
716
|
POST
|
That's why I added the "%f" in the strftime It's hard to say what's the issue. I don't really undersrtand what the .sdf is about? Likely issue is something other than datetime formats. Do this: go to the query task to your feature service and fill in the WHERE input parameter with what you think is correct. If it works that's the formatting of your WHERE statement in your python script.
... View more
12-08-2022
12:19 PM
|
0
|
0
|
1066
|
POST
|
The utc_offset argument within the generate_report() method is a simple string value depicting a number of hours formatted as '-04:00' for example. However this does not take into account daylight savings time (DST) at all since it's just a simple hardcoded string value. Is this just an oversight of the ESRI Python API? I've written a workaround to accommodate this issue already but was curious if I'm overlooking something here.
... View more
12-08-2022
11:22 AM
|
0
|
0
|
208
|
POST
|
Just from my own observations by looking at result counts from querying the service pre/post delete, it's pretty obvious that there's a 500,000 maximum limit on the number of features the delete request processes with Future=True argument. I have not confirmed this with ESRI or found info in the documentation tho, just my quick/simple checks.
... View more
12-07-2022
08:42 AM
|
0
|
0
|
420
|
POST
|
last_24hour_date_time = datetime.now() - timedelta(hours = 24)
timestamp = last_24hour_date_time.strftime('%Y-%m-%d %H:%M:%S.%f')
nspd=Inspform.layers[0].query(where = "CreationDate>= '{}'".format(timestamp)).sdf
... View more
12-06-2022
07:53 PM
|
0
|
2
|
1231
|
POST
|
It's expecting a formatted date. I do something similar to setup where clause for querying the last 24 hours on a feature layer. from datetime import datetime, timedelta
last_24hour_date_time = datetime.now() - timedelta(hours = 24)
timestamp = last_24hour_date_time.strftime('%Y-%m-%d %H:%M:%S')
whereClause = "CreationDate>= '{}'".format(timestamp)
... View more
12-06-2022
06:00 PM
|
0
|
4
|
1324
|
POST
|
You probably just want feature_layer.query(). Take a look at the docs
... View more
12-06-2022
05:25 PM
|
0
|
6
|
1359
|
POST
|
I have a hosted Notebook running on our AOGL org that performs a data sunset/delete on hosted services after a specified number of days using a where statement in the delete_features() as well as Future=True. In most cases this works, but in some instances, it seems to stop the deletion process after submitting the request. Recent execution attempted to delete 1.5 million features from a hosted service but only about 550,000 features are deleted. I checked this by determining the initial count of features to delete then navigating to the service query task endpoint and running the same where filter to get a feature count. As it stands (about 1 hour later): Initial count: 1.5 million features Current count: 950,500 features Is there some kind of limit I am running into here?
... View more
12-06-2022
08:09 AM
|
0
|
1
|
449
|
POST
|
Resolved: sorry I took a closer look at this and the issue is NOT with the delete_features() method, it's actually just above this where I am first checking to see if there are any features to delete by executing a simple layer.query(). I think it's simply a matter of too many features being returned in that request and attempting to count the results of the query. Instead, I just simply added the return_count_only=True parameter to accomplish this, recQuery = layer.query(where="{} < '{}'".format(row.attributes['dateColumnName'],(datetime.utcnow() - timedelta(days=row.attributes['daysToKeep'])).strftime("%Y-%m-%d %H:%M:%S")),return_count_only=True) Which validates just fine and allows me to check the recCount and apply my conditional logic as needed.
... View more
11-22-2022
11:45 AM
|
0
|
0
|
498
|
POST
|
Hi all, I have a Notebook hosted in our AGOL org that will sometimes fail with error code 400 "Cannot perform query. Invalid query parameters. Unable to perform query. Please check your parameters.". But successfully executes at other times. The 'where' parameter is built at runtime to setup a datetime query and full statement looks like, layer.delete_features(where="{} < '{}'".format(row.attributes['dateColumnName'],(datetime.utcnow() - timedelta(days=row.attributes['daysToKeep'])).strftime("%Y-%m-%d %H:%M:%S")),future=True) The actual query at runtime would read as (or the datetime from 479 days ago compared to utcnow(), location_timestamp < '2021-07-31 18:55:18' When running this same exact where against the REST query api it works as expected. Again, this will successfully run the delete_features() method at times so I'm unsure how to trace the issue if it is an intermittent problem as this Notebook runs on AGOL hosted environment.
... View more
11-22-2022
11:23 AM
|
0
|
1
|
506
|
POST
|
Hi, We were trying to find a way to use the seconds value from a datetime for other use (concatenate into another value) and thought you may find this useful. The simplest method was to use the scripts component accessible in Connect and then added the pulldata functionality to acquire the seconds from the script. Open the survey in Connect and add a new script: function getSeconds() {
const padL = (nr, len = 2, chr = `0`) => `${nr}`.padStart(2, chr);
var currentDateTime = new Date( now() );
var resultInSeconds=padL(currentDateTime.getSeconds());
return `${resultInSeconds}`;
} Save it as getSeconds.js In your XLSForm field, access the seconds value by applying pulldata function like so, string(pulldata("@javascript","getSeconds.js","getSeconds")) The Javascript should also pad any digit 1-9 with a leading zero.
... View more
10-31-2022
12:43 PM
|
1
|
1
|
1018
|
POST
|
That works. Thanks -- I really was questioning if I had to actually iterate the dataframe! This will def simplify it a level or two.
... View more
10-25-2022
01:28 PM
|
0
|
0
|
1059
|
POST
|
I guess I have to use the pandas dataframe object of the tabSet? for tab in sunsetTabItem.tables:
tabSet = tab.query(where='1=1',as_df=True)
for index, row in tabSet.iterrows():
print (row.itemId + "|" + str(row.daysToKeep)) Produces: 416c10d63b78464798abc3c10e70c71b|10
105f5c3e534744da9df8a0d8953fffc2|5
None|1
None|1
None|1
None|1
None|1
None|1
None|1
None|1
None|1 I guess I was expecting the python API to provide access to values of columns specified (ie, ".itemId")
... View more
10-25-2022
12:35 PM
|
0
|
0
|
1071
|
Title | Kudos | Posted |
---|---|---|
1 | 08-08-2022 01:40 PM | |
1 | 02-15-2019 08:21 AM | |
2 | 08-14-2023 07:14 AM | |
1 | 07-10-2023 01:25 PM | |
1 | 05-19-2023 08:38 AM |
Online Status |
Offline
|
Date Last Visited |
08-19-2024
09:15 PM
|