1
<div ui-sortable="sortableSection" ng-model="mainInputs" class="first">
<div ng-repeat="(i, input) in mainInputs | orderBy: input.type">
<div class="alert alert-success rounded gradient" >{{ input.text }}</div>
</div>
</div>
<div ui-sortable="sortableSection" ng-model="column" class="connected-apps-container" style="min-height: 40px;">
place your elements here
</div>
var mainInputs = function(){
return [
{
type: 'radio',
text: 'Radio group',
"content_to_drop": {
type: 'radio',
contents: [{
text: 'radio 1',
value: '1'
},{
text: 'radio 2',
value: '2'
},{
text: 'radio 3',
value: '3'
}]
}
},
{
type: 'checkbox',
text: 'Checkbox Input',
"content_to_drop": {
type: 'checkbox',
contents: [{
text: 'checkbox 1',
value: '1'
},{
text: 'checkbox 2',
value: '2'
},{
text: 'checkbox 3',
value: '3'
}]
}
}
];
};
這是一個拖放示例。 被拖動的元素之一將被插入column
陣列中。Angularjs ui可排序 - 替換已丟棄項目的內容
我的問題:
而不是添加整個對象,我只是隻希望column
陣列裏面被添加了「content_to_drop」對象。有沒有可能做到這一點?
爲了更好地看: https://jsfiddle.net/ssftkp96/