2015-11-05 106 views
3

我使用ui-selectangular-xeditable。 in this sample一切正常,但型號未更新(選擇項目時,foo.bar不會更改)。你可以幫我嗎?型號不更新角度可調,角度Ui-選擇

<span editable-ui-select="foo.bar" e-ng-model="foo.bar" e-name="bar" name="bar" e-form="editableForm"> 
     {{foo.bar.name}} 
     <editable-ui-select-match placeholder="Search..." style="width:500px"> 
     {{$select.selected.name}} 
     </editable-ui-select-match> 
     <editable-ui-select-choices repeat="b in bars | filter:$select.search"> 
     {{b.name}} 
     </editable-ui-select-choices> 
    </span> 
+1

你肯定是x可編輯已經實現了ui-select?我在x-editable文檔 – Beartums

+0

thanx中的任何地方都沒有看到它的響應,x-editable沒有實現ui-select,但該示例有一個指示,用於在x-editable中使用ui-select,一切正常,但僅限於型號在用戶選擇項目時不更新。 plase看看例子。 – ali

+0

您是否找到了解決方案?謝謝。 – Sampath

回答

0

我還在測試,但經過許多哭泣和一些祈禱。以下修改適用於我。接到https://habrahabr.ru/post/277001/

UI,選擇支持的想法: https://github.com/vitalets/angular-xeditable/pull/300/files#diff-90635473805044e26bceb2f7ffecfa82

我添加了2線渲染功能上面的代碼

this.inputEl.attr('on-select', 'fooEvent($item)'); 
this.inputEl.attr('ng-model', '$parent.$data'); 

var dir = editableDirectiveFactory({ directiveName: 'editableUiSelect', inputTpl: '<ui-select></ui-select>', render: function() { this.parent.render.call(this); this.inputEl.append(rename('ui-select-match', match)); this.inputEl.append(rename('ui-select-choices', choices)); this.inputEl.attr('on-select', 'fooEvent($item)'); this.inputEl.attr('ng-model', '$parent.$data'); } });