javascript - Getting the current value of an xeditable checkbox while form is being edited -



javascript - Getting the current value of an xeditable checkbox while form is being edited -

i have checkbox displayed if checkbox checked, have when form beingness edited. since model doesn't updated when it's beingness edited, can't ng-show sec checkbox based on model's value.

tl;dr: getting value of xeditable checkbox during editing form

this html i'm using:

<div class="col-xs-1 pad-xs text-center"> <span editable-checkbox="field.left"> <span class="fa fa-check" ng-if="field.left"></span> </span> </div> <div class="col-xs-1 pad-xs text-center"> <span editable-checkbox="field.right" ng-show="~~here~~"> <span class="fa fa-check" ng-if="field.right"></span> </span> </div>

i can add together e-ng-change first checkbox determine change, have no way of retrieving value correctly.

oh, think figured out.

if pass this function, $data parameter reflect current value of checkbox.

<div class="col-xs-1 pad-xs text-center"> <span editable-checkbox="field.left" e-ng-change="changefield(this, field)"> <span class="fa fa-check" ng-if="field.left"></span> </span> </div> <div class="col-xs-1 pad-xs text-center"> <span editable-checkbox="field.right" e-ng-show="field._left"> <span class="fa fa-check" ng-if="field.right"></span> </span> </div>

in changefield function, i'm using this

$scope.changefield = function(self, field) { field._left = self.$data; };

javascript angularjs x-editable

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -