Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular-XEditable e-onChange

Here is my code

<span editable-select="item.text" e-ng-options="p.id as p.name for p in products" e-form="rowform" 
          onbeforesave="checkName($data)" e-required e-name="name" 
          e-onChange="scopeFunction($data)">
      {{ showProductName(item.text) || 'Enter Name of a product' }}
    </span>

Is it possible to access controller's $scope in e-onChange?

If I enter e-onChange="scopeFunction(data)" it throws an error "ReferenceError: scopeFunction not defined"

What I want is after selecting a new value to be able to change another field's value.

like image 624
user1076731 Avatar asked Dec 20 '22 04:12

user1076731


1 Answers

Use angular's e-ng-change instead (with the 'e-'-prefix for the editable element):

<span editable-select="item.text" 
    e-ng-options="p.id as p.name for p in products" e-form="rowform" 
    onbeforesave="checkName($data)" e-required e-name="name" 
    e-ng-change="scopeFunction($data)">
        {{ showProductName(item.text) || 'Enter Name of a product' }}
</span>
like image 191
andzep Avatar answered Jan 05 '23 06:01

andzep