Recently I asked a question in stack (How to search on values of a value list in python toolbox?). This question is about enable some default buttons in the tool. I wonder why the add, delete and order buttons not working for me. I want to order entries(rows) by order buttons but the order buttons only select records. Is that any config to enable these buttons? The full image of this tool can be found in the past question.
2 Answers 2
I think the short answer is no, you cannot alter the properties of these buttons as they are not exposed. I have found no way to hook into the onclick event of these buttons. May be there is a way, sure would like to know!
This table view control is flaky as I know some of the ESRI geo-processing tools that expose this control don't even work so don't be surprised it's not working for you, you have not done anything wrong!
-
I might not be able to help with your question, but did you write a tool that uses these buttons? If you did, can we see how you set up your parameters? I'd like to test it on my machine.keepaustinbeard– keepaustinbeard2016年11月14日 15:29:27 +00:00Commented Nov 14, 2016 at 15:29
-
No I did not write any code to use these buttons as there is nothing in the Help file about them or how to access\interact them.Hornbydd– Hornbydd2016年11月14日 15:32:57 +00:00Commented Nov 14, 2016 at 15:32
In my previous question( How to search on values of a value list in python toolbox?) ] I used "if not parameters[3].altered:" to enable update the value in value table. When i used this code, value table buttons enabled automatically.
This is a part of my code :
def updateParameters(self, parameters):
if parameters[2].altered:
if not parameters[3].altered:
result = arcpy.GetCount_management(parameters[2].value)
count = int(result.getOutput(0))
with arcpy.da.SearchCursor(parameters[2].value,["Station","Line","Row"]) as cur:
vtab = []
for row in cur:
vtab.append([row[0],row[1],row[2]])
parameters[3].value = vtab
parameters[3].filters[2].list = range(1,count+1)
return