vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

Change Scope when edit mode #653

Closed pavi95 closed 7 years ago

pavi95 commented 7 years ago

Hi I am using X editable for my website. I am googling for many hours, still not get any solution for my scenario. Please help me out. My Questions:

  1. I have to choose drop down A, based on the selected value, scope values will update by retrieving the data from API and load it to another drop down B.
  2. And i have another drop down C, based on this selection. I need to show different input types. For eg: If i choose the value "url", i have to show text box If i choose the value "code", i have to show text area If i choose the value "type", i have to show select box.

For Q1, I tried with the watch, filter, everything seems doesn’t work :( For Q2, Is it possible to do this, If so please give me an example.

Please help me out. I am using Angular 1.5.8, smart table 2.1.8 and Xeditable 0.5.0

ckosloski commented 7 years ago

You posted this https://jsfiddle.net/32kzsvve/1/ previously which you said helped you. What is not working for you? If you want more specific help, you will need to post a jsfiddle/plunkr so people can see your code and help you with your issues.

pavi95 commented 7 years ago

Yes it worked only for the static data not for the dynamic API call. That is my problem here. Please find the js fiddle here https://jsfiddle.net/Pavi95/k2f6osdu/1/

ckosloski commented 7 years ago

When I go to that fiddle, I see the following JS errors:

Error: [$injector:nomod] Module 'BlurAdmin.pages.feeds' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.5.8/$injector/nomod?p0=BlurAdmin.pages.feeds  angular.js:68:12
"Error: [$injector:unpr] Unknown provider: editableOptionsProvider <- editableOptions <- FeedsPageCtrl

You are also using an older version of xeditable.

pavi95 commented 7 years ago

Please check this fiddle https://jsfiddle.net/Pavi95/k2f6osdu/5 I updated sample data format below HTML section

ckosloski commented 7 years ago

@pavi95 The jsfiddle link is broken.

pavi95 commented 7 years ago

@ckosloski I fixed this by using angular way of jquery :)