danhunsaker / angular-dynamic-forms

Build Forms in AngularJS From Nothing But JSON (please see Alternatives in the README)
MIT License
379 stars 140 forks source link

"Select" not cascade mode #43

Closed jcsena closed 5 years ago

jcsena commented 9 years ago

as the cascade mode to "select " is performed?

danhunsaker commented 9 years ago

I'm afraid I have no idea what you mean, here...

jcsena commented 9 years ago

Mmm. ok , look at this example.. http://jsfiddle.net/annavester/Zd6uX/

danhunsaker commented 9 years ago

So you're looking for a way to do this in ngDynForms?

jcsena commented 9 years ago

exactly! ngDynForms supports this?

danhunsaker commented 9 years ago

Only about the same way the jsFiddle you shared does. All ngDynForms does is let you build the form; logic is beyond its scope. For now, the idea is to find existing implementations of non-HTML5 controls (that is, controls that aren't natively part of the HTML spec) and have ngDynForms create one of them using the control's attributes.

That said, I'm planning a major refactor that will support plugins, and this sounds like a perfect plugin candidate to me.

jcsena commented 9 years ago

OK, I understand I will figure then inject the information on my main controller,

another question ,

  {
    "type": "select",
    "model": "select",
    "label": "select",
    "empty": "empty",
    "options": {
      "second": {
        "label": "second option",
        "group": "first group"
      },
      "third": {
        "label": "third option",
        "group": "second group"
      }
    }
  }

in options may have an array and not an object Ex:


  "options": [
     {
       "name": "second"
        "label": "second option",
        "group": "first group"
      },
     {
        "name": "third"
        "label": "third option",
        "group": "second group"
      }
    ]
danhunsaker commented 9 years ago

That's something I'm working on, and haven't had the chance to push, yet. Though it'll be val instead of name.

rmacteague commented 9 years ago

Any idea when options for selects and radios in array form will be implemented?

jcsena commented 9 years ago

@rmacteague http://stackoverflow.com/questions/18723399/cascading-select-dropdowns