Comments (12)
@christianacca
could you describe a bit the usecase when you need it?
from angular-xeditable.
Of course.
The specific use case I'm targeting is as follows.
- onshow I have an event handler that sets the state of the particular
model as being in edit mode - onclose would then cancel this editing state
The onaftersave would probably have been sufficient but it seems this hook
only gets called when the user confirms acceptance of their changes.
Christian
On 13 Oct 2013 08:42, "Vitaliy Potapov" [email protected] wrote:
@christianacca https://github.com/christianacca
could you describe a bit the usecase when you need it?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-26213055
.
from angular-xeditable.
yes, onaftersave is called only when changes are applied.
I will think about onclose / oncancel
callbacks..
But also, didn't you try $visible
property of form?
I mean
<a editable-text="user.name" e-form="myform">
Now scope.myform.$visible
flag refers to form's state.
from angular-xeditable.
Yeah I did think about that. Infact I used it already in one place in the
code. I'll give some more details once I get in front of the code.
I ended up "pushing the boundaries" I think with x-editable making a master
detail table that allows for adding additional records to the table. I
think this drove the need for having an onclose. Like I say I'll get in
front of the code and let you know.
BTW, excellent job on what you've done so far.
C
On 13 Oct 2013 20:13, "Vitaliy Potapov" [email protected] wrote:
yes, onaftersave is called only when changes are applied.
I will think about onclose / oncancel callbacks..
But also, didn't you try $visible property of form?
I meanNow scope.myform.$visible flag refers to form's state.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-26224599
.
from angular-xeditable.
thank you! :)
For adding new records you may have a look on just released 0.1.5 docs http://vitalets.github.io/angular-xeditable/#editable-row
from angular-xeditable.
Cool. Will look at this tonight.
On 14 Oct 2013 09:47, "Vitaliy Potapov" [email protected] wrote:
thank you! :)
For adding new records you may have a look on just released 0.1.5 docs
http://vitalets.github.io/angular-xeditable/#editable-row—
Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-26242773
.
from angular-xeditable.
Hi Vitaliy,
Had a look at the example for adding a row. I had already done something similar and then tweaked things to make the behaviour fit how I needed the "grid" to work. For example, I needed an editable table. I also wanted the table to be placed in edit mode as soon as the Add button was clicked. Lastly I needed to be to have the cancel button undo the newly added row.
To make the newly added row be in edit mode I had to to do something that felt a little bit of a hack. I ended up having to defer the call to tableForm.$show until after the new row had been rendered in the DOM. I did this by scheduling the call to $show inside a $timeout.
If you're interested in a working example of this I've updated your example here: [http://jsfiddle.net/christianacca/gpgD4/](http://jsfiddle.net/christianacca/gpgD4/
I still need to explain why I think there's a need for an onclose hook... I'll post that a little later once I've experimented a bit more with $visible.
Christian
from angular-xeditable.
hi @christianacca
I think creating new row already in edit mode is good idea.
I've updated docs: http://vitalets.github.io/angular-xeditable/#editable-row
To have whole table in edit mode you can also use ng-init
directive..
from angular-xeditable.
Nice example - really liked how focus is immediately on the first input in
the newly added row.
Not sure how I could use the ng-init to add a new row to an editable
table that would achieve the following:
- Click on the add row button
- New row added to the table
- Entire table (including new row) is in edit mode
- Focus is immediately on the first input in the newly added row
It would be brilliant if you include a new example or update the existing
editable table example :-) If you stuck for time then maybe just some more
pointers so that I can figure it out myself.
Thanks
Christian
On Tue, Oct 15, 2013 at 8:30 AM, Vitaliy Potapov
[email protected]:
hi @christianacca https://github.com/christianacca
I think creating new row already in edit mode is good idea.
I've updated docs:
http://vitalets.github.io/angular-xeditable/#editable-rowTo have whole table in edit mode you can also use ng-init directive..
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-26314220
.
from angular-xeditable.
Hi Vitalets,
About that use case for when onclose (with a isCancel argument). I have changed tact a little so that I have now an editable table row for the master table (for the nested details I'm using an editable table).
Anyway, because an editable row has buttons that I manually define, I can define on ng-click event to hook the form open/close events. So the use case I was going to talk about has gone away for the moment.
I suspect another scenario will pop up and in which case the onclose hook would be useful for those inputs that are not wrapped in a form with buttons that I can hook.
Christian
from angular-xeditable.
hi @christianacca
yes I think these hooks can be usefull anyway.
I plan to add oncancel
- called when form is cancelled and onhide
- called when form both saved or cancelled.
I'll reopen the issue to keep it in mind for nest release.
from angular-xeditable.
Cool!
On 16 Oct 2013 14:12, "Vitaliy Potapov" [email protected] wrote:
hi @christianacca https://github.com/christianacca
yes I think these hooks can be usefull anyway.
I plan to add oncancel - called when form is cancelled and onhide -
called when form both saved or cancelled.
I'll reopen the issue to keep it in mind for nest release.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-26416106
.
from angular-xeditable.
Related Issues (20)
- Is there a way to disable a checkboxe inside a checklist? HOT 6
- Bootstrap 4 Theme? HOT 2
- Use editable within form HOT 2
- using splice() instead of push to add new items in table HOT 7
- How to integrate ckeditor in x-editable angular HOT 6
- Radiolist doesn't support string as status.value
- Xeditable Redirection HOT 1
- Control deselects when navigating outside the area HOT 8
- Ui date picker change month closing inline edit automatically HOT 1
- Select doesn't support string as status.value HOT 5
- Select Option Click - Model getting closed automatically HOT 1
- $watch of nested directive is not triggered when form's onaftersave get called HOT 6
- the issue while the closing the input area when the input field was being in error or invalid state HOT 5
- How to save empty ng-tags-input as array? HOT 2
- How to change display value when editing form? HOT 8
- Does editable-checklist support e-name? HOT 4
- console.log still present HOT 5
- Checkbox doesn't support JSON objects HOT 1
- Editable number buttons are not responding in Firefox
- popover=true attribute conflicts with Popover API HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-xeditable.