Hi
ability to create controls, fields etc in javascript code would be great!
create controls and fields etc in code
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 118
- Joined: Tue Oct 23, 2012 7:01 am
- Location: The Netherlands
- dvanhussel
- Ebase User
- Posts: 161
- Joined: Fri Oct 19, 2007 12:45 pm
- Location: Haarlem, the Netherlands
You can 'create fields' in code by using a field of type object.
In an object it is possible to store any data you want.
Something like this:
I don't understand when you would want to create controls in code. How would you control where the controls's would be placed on the page?
In an object it is possible to store any data you want.
Something like this:
Code: Select all
//initial object
var testObject = {
firstName:"John",
lastName:"Doe"
};
fields.TESTOBJECT.value = testObject;
//read some data from the object field
controls.HTML1.htmlText.text='Firstname is: '+fields.TESTOBJECT.value.firstName;
//add extra data to the object field
testObject.age = 20;
fields.TESTOBJECT.value= testObject;
//read the extra data
controls.HTML1.htmlText.text= controls.HTML1.htmlText.text+'<br>Age is: '+fields.TESTOBJECT.value.age;
0 x
-
- Ebase User
- Posts: 118
- Joined: Tue Oct 23, 2012 7:01 am
- Location: The Netherlands
Hi Dave,
Thanks. Although you have to have a field to hold the object it is not a real 'creating', but it is a nice solution. The reason for adding controls could be to ask a user to create a 'data structure' and then dynamicly add the controls (input) for them (underneath each other).
Thanks. Although you have to have a field to hold the object it is not a real 'creating', but it is a nice solution. The reason for adding controls could be to ask a user to create a 'data structure' and then dynamicly add the controls (input) for them (underneath each other).
0 x
Kind regards,
Harry
Harry
Who is online
Users browsing this forum: No registered users and 4 guests