I'm creating a dynamic form to create characters for my game so I have a list and I can edit each item etc but in the edit modal popup I would like to display a dropdown menu of character classes coming from property sets so I was wondering how I can do this?.. I thought I could do it using gs-query but I only need the drop menu not the other options.
Best Answer
H
Hjupter Cerrud
said
about 4 years ago
I just solved this myself so I'm posting it here just in case anyone else have the same question:
This is the javascript:
var classes = [];
var classProp = Spark.getProperties().getProperty("characterClasses");
for (i = 0; i < classProp.data.length; i++) {
var cl = classProp.data[i];
classes.push({name: cl, selected: cl == form.class});
}
form.characterClasses = classes;
Hjupter Cerrud
I'm creating a dynamic form to create characters for my game so I have a list and I can edit each item etc but in the edit modal popup I would like to display a dropdown menu of character classes coming from property sets so I was wondering how I can do this?.. I thought I could do it using gs-query but I only need the drop menu not the other options.
I just solved this myself so I'm posting it here just in case anyone else have the same question:
This is the javascript:
And this is the html code:
Hjupter Cerrud
I just solved this myself so I'm posting it here just in case anyone else have the same question:
This is the javascript:
And this is the html code:
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2486 topics