2017-04-07 4 views
0

목록보기에서 선택된 목록보기를 격자에 표시하려고합니다. 선택한 모든 항목이 홈 페이지에 표시됩니다. 하지만 그렇게 할 수있는 방법을 찾을 수 없습니다. 나는 팝업의 JS 파일 코드와 스크린 샷목록보기 syncfusion

var subItemsLoaded = false, 
 
    SubItemSelectionModalId = '#subItemSelectionModal'; 
 
listViewHeight = 400, 
 
subItemClicked = 0; 
 

 
$(SubItemSelectionModalId).on('shown.bs.modal', function() { 
 
    if (
 
     (window.selections.assetTemplate.id != null && 
 
     window.selections.assetTemplate.id != 0)) { 
 
     $(SubItemSelectionModalId + ' .modal-body').ejWaitingPopup({ 
 
      showOnInit: true 
 
     }); 
 
     $(SubItemSelectionModalId + ' .listViewItems').ejListView({ 
 
      "height": 400, 
 
      "loadComplete": function() { 
 
       repositionSearchBoxFor(SubItemSelectionModalId); 
 
       var obj = $(SubItemSelectionModalId + ' .modal-body').data("ejWaitingPopup"); 
 
       console.log("12345.5"); 
 
       obj.hide(); 
 
       console.log("123456"); 
 
      }, 
 

 
      "mouseUp": function (e) { 
 
      }, 
 
      "enableAjax": true, 
 
      "enableCheckMark": true, 
 
      "enableFiltering": true, 
 
      "dataSource": ej.DataManager({ 
 
       "url": "/Shared", 
 
       "cachingPageSize": 0, 
 
       "timeTillExpiration": 0 
 
      }), 
 
      "query": ej.Query().from("GetSubItems").addParams("assetTemplateId", window.selections.assetTemplate.id).addParams("assetTemplateVariantId", window.selections.assetTemplateVariant.id), 
 
      "fieldSettings": { 
 
       "text": "SubItemName", 
 
       "id": "SubItemId" 
 
      } 
 
     }); 
 
    } 
 
}); 
 

 
$(SubItemSelectionModalId).on('hidden.bs.modal', function() { 
 
    var listViewItems = $(SubItemSelectionModalId + ' .listViewItems'); 
 
    if (listViewItems.find('ul').length > 0) { 
 
     var selections = $(SubItemSelectionModalId + ' .listViewItems').ejListView("getCheckedItems"); 
 
     if (selections.length > 0) { 
 
      $('#selectedSubItems').html(selections.join(' , ')).removeClass('hidden'); 
 
     } 
 
    } 
 
});

enter image description here

답변

0

네, 그리드에서 목록보기의 선택 항목을 표시 할 수 붙어있다. 이를 위해서는 Listview의 mouseUp 이벤트를 사용하여 목록의 선택된 항목을 가져와 선택한 항목을 Grid 컨트롤의 dataSource로 제공해야합니다.

또한 선택한 목록의 ID를 가져 오려면 ID 속성을 가져 와서 해당 ID를 가져와 ID 필드를 Grid 컨트롤의 열로 바인딩해야합니다. 이렇게하면 Listview에서 특정 목록의 ID를 가져온 다음 Grid에 바인딩 할 수 있습니다. http://jsplayground.syncfusion.com/prahqy2i

감사합니다,
아룬 P.

:

우리는 또한 당신의 참조를 위해 샘플을 준비했습니다