Angular-XEditable e-onChange

user1076731 picture user1076731 · May 11, 2015 · Viewed 7.1k times · Source

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.

Answer

andzep picture andzep · Aug 6, 2015

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>