vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

Typeahead input formatter function firing before onshow #533

Closed westerncj closed 8 years ago

westerncj commented 8 years ago

I'm trying to use the typeahead editable but I'm running into some problems when using onshow="vm.loadList()" and e-typeahead-input-formatter="vm.formatField($model)". The e-typeahead-input-formatter function is called before the onshow function so my list is blank thus my input is blank when it becomes editable. Does onshow not complete before it formats the input?

ckosloski commented 8 years ago

Is the onshow list different that the list you are passing into e-uib-typeahead?

westerncj commented 8 years ago

No it's the same list. I was loading the list initially when the page loaded, but I'd rather load the list onshow because I think it makes more sense.

westerncj commented 8 years ago

I can close this now if you'd like. I found a workaround with my vm.formatField() function by evaluating if the list is loaded yet. If the list isn't loaded then I'm setting it equal to the local model value in the dataset. Thanks for your help and let me know.

ckosloski commented 8 years ago

Yes, if you figured out a solution, go ahead and close the issue.