0

I want to change/update a model in run time which is created with

var model = qx.data.marshal.Json.createModel(def.model) .

and binding textfields with object controller which is created with this

var controller = new qx.data.controller.Object(model)

How to do it? de.model is a JSON definition for model which is look like this :

{
     f_name: "baskar",
     l_name: "vignesh"
} 

for example I want to add address field with this existing model. so

{
     f_name: "baskar",
     l_name: "vignesh",
     address: "blah blah blah"
} 

How to do it? anyone please help me. Thanks in advance

Baskar.M
  • 561
  • 1
  • 6
  • 25

1 Answers1

0

As models are instances of dynamically created classes, that's not possible. You can not change a class in place and with that, all instances of it. The way to go would be to create a new model and copy the data over. Thats the only possible way I can think of right now.

Martin Wittemann
  • 2,109
  • 1
  • 12
  • 14