2016-04-25 7 views
0

私はui-gridから別のWebアプリケーションに選択したデータをエクスポートしようとしています。だから、私はこれはこれまでの作品、誰かがのすべての値をエクスポートし、その後、選択された行を取得する方法の方向に私を指すことができます...機能をフォームポストで選択したデータをエクスポートする方法

 gridMenuCustomItems: [ 
     { 
      title: 'Export to Texter', 
      action: function($event) { 
      console.log($scope.gridApi); 
      alert('do the export here'); 
      }, 
      order: 210 
     } 
     ], 

をカスタムメニュー項目を追加しました1つの列(RegID、私の場合)は、フォームの投稿を介して?私が働いて何かを持っているhttps://plnkr.co/edit/qsWac1FtIiblBKL3qALM?p=preview

答えて

0

は、ここに私のplunkerです。私は誰かがそれを改善できると確信しています(私はそれに慣れているので、それは利用可能です)フォーム提出のjQueryに頼らざるを得なくてはなりませんでしたが、これは私のために働いています。

新しいアプリにリダイレクトするためにページ全体が必要だったので、AJAXの処理では十分ではありませんでした。

 gridMenuCustomItems: [ 
     { 
      title: 'Export selected to Some App', 
      action: function($event) { 
      var currentSelection = $scope.gridApi.selection.getSelectedRows(); 
      var currentSelectionUserIds = []; 
      currentSelection.forEach(function(entry) { 
       currentSelectionUserIds.push(entry.userId); 
      }); 
      $myExportForm = $('<form id="ExportForm" action="/Link/To/My/App/" method="post"><input type="hidden" name="UserIDs" value="' + currentSelectionUserIds + '"></form>'); 
      $('body').append($myExportForm); 
      $myExportForm.submit(); 
      }, 
      order: 210 
     } 
     ], 
関連する問題