create controls and fields etc in code

Post any suggestions or enhancement requests about the Verj.io platform or this Forum

Moderators: Jon, Steve, Ian, Dave

HarryDeBoer
Ebase User
Posts: 118
Joined: Tue Oct 23, 2012 7:01 am
Location: The Netherlands

create controls and fields etc in code

#1

Postby HarryDeBoer » Thu Jul 31, 2014 2:57 pm

Hi

ability to create controls, fields etc in javascript code would be great!
0 x
Kind regards,

Harry

User avatar
dvanhussel
Ebase User
Posts: 161
Joined: Fri Oct 19, 2007 12:45 pm
Location: Haarlem, the Netherlands

#2

Postby dvanhussel » Fri Aug 01, 2014 6:01 pm

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:

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&#58; '+fields.TESTOBJECT.value.age;
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?
0 x

HarryDeBoer
Ebase User
Posts: 118
Joined: Tue Oct 23, 2012 7:01 am
Location: The Netherlands

#3

Postby HarryDeBoer » Thu Aug 07, 2014 1:09 pm

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).
0 x
Kind regards,

Harry


Who is online

Users browsing this forum: No registered users and 35 guests