2017-10-13 24 views
0

私はserviceNowを初めて使用し、Accordianウィジェットを作成してProjectNameでグループ化されたテーブルに情報を表示しようとしています。ServiceNow Service Portal AngularJS Accordianウィジェットが動作しない

ウィジェットエディタでこのコードを実行すると、アコーディオンが表示されますが、{{mytable.id}}は入力されておらず、プロジェクト名のみが表示されています。

また、非ユニークIDに起因すると思われるトッププロジェクト名のみが折りたたまれています。

これを解決する方法がわかりません。

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> 
 
<div class="panel-group" id="accordian"> 
 
    <div class="panel panel-{{mytable.id}}" ng-repeat="mytable in data.mytables"> 
 
    <div class="panel-heading" role="tab" id="heading_{{::mytable.pid}}"> 
 
     <div class="panel-group" id="accordian"> 
 
     <div class="panel panel-{{mytable.id}}" ng-repeat="mytable in data.mytables"> 
 
      <div class="panel-heading" role="tab" id="heading_{{::mytable.pid}}"> 
 
      <span class=”panel-title”> 
 
\t \t <a role=”button” data-toggle=”collapse” href=”#collapse_{{mytable.id}}” aria-expanded=”true” aria-controls=”collapse_{{::mytable.id}}”> 
 
\t \t \t <i class=”fa fa-chevron-down”></i>{{::mytable.project_name}} <span class=”badge”>{{::mytable.count}}</span> 
 
      </a> 
 
      </span> 
 
      </div> 
 
      <div id=”#collapse_{{::mytable.id}}” class=”panel-collapse collapse” role=”tabpanel” aria-labelledby=”heading_{{::mytable.id}}”> 
 
      <div class=”panel-body”> 
 
       <table class=”table”> 
 
       <thead> 
 
        <tr> 
 
        <th>Month</th> 
 
        <th>Year</th> 
 
        <th>PDF</th> 
 
        <th>XLS</th> 
 
        <th> 
 
       </thead> 
 
       <tbody> 
 
        <tr> 
 
        <td>{{::mytable.invoice_month}}</td> 
 
        <td>{{::mytable.invoice_year}}</td> 
 
        <td>{{::mytable.pdf}}</td> 
 
        <td>{{::mytable.xls}}</td> 
 
        </tr> 
 
       </tbody> 
 
       </table> 
 
      </div> 
 
      </div> 
 
     </div>

/*Client Script*/ 
 
function($scope){ 
 
    var c = this; 
 
} 
 

 

 
/*Service Script*/ 
 
(function() { 
 
    data.mytables = []; 
 
    
 
    var gr = new GlideAggregate('x_project_table'); 
 
    gr.addActiveQuery(); 
 
    gr.groupBy('project_name'); 
 
    gr.query(); 
 
    
 
    while(gr.next()){ 
 
     var mytable = {}; 
 
     mytable.project_name = gr.getDisplayValue('project_name'); 
 
     mytable.invoice_month = gr.getDisplayValue('invoice_month'); 
 
     mytable.invoice_year = gr.getDisplayValue('invoice_year'); 
 
     mytable.pdf = gr.getDisplayValue('pdf'); 
 
     mytable.xls = gr.getDisplayValue('xls'); 
 
     data.mytables.push(mytable); 
 
    } 
 
})(); 
 
    

答えて

0

{{mytable.id}}あなたのサーバスクリプトでそれを指定しなかったので、移入されていません。

あなたは次のようなものが必要ですmytable.id= gr.getValue('sys_id');

関連する問題