IgniteEngine-iOS icon indicating copy to clipboard operation
IgniteEngine-iOS copied to clipboard

Need the ability to reference a control via a controlLocation attribute

Open garazi opened this issue 10 years ago • 3 comments

In order to simplify $views, I'd like to be able to define a control as its own external JSON, and then add/reference it via an attribute. For example:

{
    "_id": "inputSearch",
    "_type": "TextInput",
    "controlLocation": "controls/myTextInput.json"
}

The extrernal JSON would look just like the control if it was added in the main view, except it wouldn't have an _id property. (Not sure if the above example would have the _type declared there or in the external control. For readability, it might make sense to have it in the main $view file... but it probably should also still be declared in the external JSON as well.)

garazi avatar Mar 27 '15 18:03 garazi

Ideally this should replace $custom entirely.

brandonscript avatar Mar 27 '15 18:03 brandonscript

Although, I can see a use for $custom, if I wanted to build a control that combined a bunch of controls into one "component". For example, in a tableview, if each row contains two Text controls, an image and a button, I might want a $custom "dataRowWidget"...

garazi avatar Mar 27 '15 18:03 garazi

You could do the same with Layout though.

brandonscript avatar Mar 27 '15 18:03 brandonscript