From 44bee9f24c14f22a57d897fce80c0ec42748ea52 Mon Sep 17 00:00:00 2001 From: Jonathon T Date: Tue, 5 Jul 2016 17:18:57 +1000 Subject: [PATCH] Added basic methods for angular-xeditable editable-form --- angular-xeditable/angular-xeditable.d.ts | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/angular-xeditable/angular-xeditable.d.ts b/angular-xeditable/angular-xeditable.d.ts index eaa1296886..01a19707e1 100644 --- a/angular-xeditable/angular-xeditable.d.ts +++ b/angular-xeditable/angular-xeditable.d.ts @@ -53,4 +53,46 @@ declare namespace angular.xeditable { */ activationEvent: string; } + + interface IEditableFormController extends angular.IFormController { + + /** + * Shows form with editable controls. + */ + $show(); + + /** + * Hides form with editable controls without saving. + */ + $hide(); + + /** + * Sets focus on form field specified by `name`.
+ * When trying to set the focus on a form field of a new row in the editable table, the `$activate` call needs to be wrapped in a `$timeout` call so that the form is rendered before the `$activate` function is called. + * + * @param name name of field + */ + $activate(name: string); + + /** + * Triggers `oncancel` event and calls `$hide()`. + */ + $cancel(); + + $setWaiting(value: boolean); + + /** + * Shows error message for particular field. + * + * @param name name of field + * @param msg error message + */ + $setError(name: string, msg: string); + + $submit(); + + $save(); + + } + }