When I try to do this:
if event.propertyName == "acao":
data = system.dataset.toPyDataSet(event.source.dsGeral)
headers = ['acao', 'txt', 'script']
newData = []
for row in data:
newRow = []
if event.newValue == row[0]:
if row[1] in (0,1):
newRow = [row['acao'], row['txt'], row['script']]
newData.append(newRow)
event.source.subpasso = row[1]
event.source.templateParams = system.dataset.toDataSet(headers, newData)
I get this error:
Parse error for event handler "propertyChange" SyntaxError: ("mismatched input '' expecting DEDENT", (' ', 12, 4, '\t\t\t\tevent.source.subpasso = subpasso\n'))
but I can do this without any issue.
if event.propertyName == "acao":
data = system.dataset.toPyDataSet(event.source.dsGeral)
headers = ['acao', 'txt', 'script']
newData = []
subpasso = 0
for row in data:
newRow = []
if event.newValue == row[0]:
if row[1] in (0,1):
subpasso = row[1]
newRow = [row['acao'], row['txt'], row['script']]
newData.append(newRow)
event.source.subpasso = subpasso
event.source.templateParams = system.dataset.toDataSet(headers, newData)
Anyone knows why this happens?