BANano.GetElement(".btn-file").On("click",Me, "File_rw")
Sub File_rw(e As BANanoEvent) ' buttons
Dim el As BANanoElement = BANano.ToElement(e.Target)
Dim parentList As List = el.Closest(".btn-file")
Dim pr As BANanoElement = parentList.Get(0)
If pr.GetAttr("id") = "config-save" Then
Log("SAVE")
Dim colectData As BANanoElement = BANano.GetElement(".mod-param")
Dim field As BANanoElement
Dim index As Long
Dim jsonMap As Map
jsonMap.Initialize
colectData.EachStart(field,index)
' Log(field.GetAttr("id") &": " & field.GetValue)
jsonMap.Put(field.GetAttr("id"),field.GetValue)
colectData.EachEnd
Dim json As JSONGenerator
json.Initialize(jsonMap)
SaveAs("moj_plik.json", "text/plain", json.ToPrettyString(1))
Else If pr.GetAttr("id") = "config-load" Then
Log("LOAD")
bf.ShowFileSelect("fuconnect")
' BANano.GetElement("#fileLoadCfg").RunMethod("change", Null)
End If
End Sub
error:
Uncaught TypeError: Cannot read properties of undefined (reading 'click')