Open hrishi1183 opened 9 years ago
Sorry, life's crazy busy for me right now (new baby in the house). I don't have time to help you right now. Could you please follow the instructions here to get help? http://help.angular-formly.com
Good luck!
On Fri, Sep 18, 2015, 9:29 PM Hrishikesh Moundekar notifications@github.com wrote:
i am trying to disable the select options based on the selected group so that same group should not be selectable in further dropdowns.. but ngModelAttrs is not working as expected with options-disabled
belows is the jsbin which shows the issue http://jsbin.com/duzuce/edit?js,output
disabledGroups already holds the "Vehicle Loans" group which mean by default Vehicle Loans should be disabled in all the three dropdown which is not the case.. and based on the selection in first select.. corresponding groupd should get disabled in further choice lists
Any help would be appreciated
— Reply to this email directly or view it on GitHub https://github.com/formly-js/angular-formly-website/issues/78.
@hrishi1183 All that the select type from angular-formly-templates-bootstrap does is perform a small wrapper around creating a
Looking into the ngOptions documentation (https://docs.angularjs.org/api/ng/directive/ngOptions) it seems that individual options can be disabled. The following code can be updated here https://github.com/formly-js/angular-formly-templates-bootstrap/blob/5ecf62aa1191488222cc9ae584390a8803757625/src/types/select.js#L13 in the angular-formly-templates-bootstrap repo. PRs welcome.
Below is the working jsbin for my issue.. http://jsbin.com/vevaka/edit?js,output current approach uses $rootScope to hold the disabled group as i was unable to update disableGroup of second select while selecting the value in first dropdown(i.e. onChange event)
I only had a minute to look at this, so I'm not certain right now what the issue is, but my first impression is that you have got to switch from storing all of this in the $rootScope
and store it in a factory
instead. It will make your life infinitely easier.
i am trying to disable the select options based on the selected group so that same group should not be selectable in further dropdowns.. but ngModelAttrs is not working as expected with options-disabled
belows is the jsbin which shows the issue http://jsbin.com/duzuce/edit?js,output
disabledGroups already holds the "Vehicle Loans" group which mean by default Vehicle Loans should be disabled in all the three dropdown which is not the case.. and based on the selection in first select.. corresponding groupd should get disabled in further choice lists
Any help would be appreciated