angularjs - jqxgrid and angular form -
i'm using jqxgrid inside angular form. when change in grid, angular form not become dirty. decided bind grid cellvaluechaned event in call $setdirty() angular form. works. not want in each place form used call $setdirty(). please tell me how can find closest form in dom tree , make dirty? want write code 1 time , want works each form there grid inside these forms. guys.
you can create directive loop on necessary html elements under , add relevant events.
here's template started:
angular.module("app", []).directive("changeform", function() { var directive = { restrict: 'a', require: 'form', link: function(scope, element, attrs, ctrl) { // here use element.find() elements // , use .on() on elements event // , use ctrl (which of type formcontroller) // set $dirty [https://docs.angularjs.org/api/ng/type/form.formcontroller] } } })
and html should like:
<form name="myform" changeform> ... </form>
Comments
Post a Comment