2014-12-15 2 views
-4

을 가지고 : 나는각도는 내가 오류가 ngRepeat입니다 중복

1.2.9이 맹목적으로 새로운 업데이트 사용하고
속는 또는 최신이 좋은하지 않습니다. |

  • 2013 이벤트 : 여기
    <script> 
    window.onload = ShoppingCartCtrl 
    
    function ShoppingCartCtrl($scope, $http) { 
    
    
         $scope.items = {[$data]}  
    
         //we want the 1st load to be sorted by sort_code 
         $scope.sortExpression = 'sort_code'; 
    
         $scope.mySortFunction = function(item) { 
          if(isNaN(item[$scope.sortExpression])) 
           return item[$scope.sortExpression]; 
          return parseInt(item[$scope.sortExpression]); 
         }  
    
         $scope.refreshSessionList = function(){ 
          //alert($scope.conference_year); 
    
          $http({ 
           method: 'POST', 
           url: 'browser.php?conference_year='+$scope.conference_year, 
           headers:{'Content-type' : 'application/x-www-form-urlencoded; charset=UTF-8'}   
    
           }); 
    
         } 
    
    } 
    
    
    </script> 
    
    
    <div class="row"> 
         <div class="large-12 columns"> 
    
    <div ng-app> 
         <div ng-controller="ShoppingCartCtrl">   
         <!-- angularJS version -->  
    
          <br /> 
          <div><strong>Filter Results</strong></div> 
    
          <table> 
           <form action="browser.php" method="POST" id="conference_year_form"> 
           <tr><td>By Conference Year:</td> 
           <td> 
    
           {[html_options id=conference_year name=conference_year options=$myOptions selected=$mySelectedConferenceYear onChange="this.form.submit()"]} 
           </td></tr> 
           </form> 
    
           <tr> 
            <td>By Session Title: </td> 
            <td><input type="text" ng-model="search.pname" /></td> 
           </tr> 
           <tr> 
            <td>By Session Code: </td> 
            <td><input type="text" ng-model="search.product_code" /></td> 
           </tr> 
           <tr> 
            <td>By Presentation Title: </td> 
            <td><input type="text" ng-model="search.presentations" /></td> 
           </tr> 
           <tr> 
            <td>By Session Speaker: </td> 
            <td><input type="text" ng-model="search.speakers" /></td> 
           </tr> 
            <tr> 
            <td>By Product Number: </td> 
            <td><input type="text" ng-model="search.productNumber" /></td> 
           </tr> 
          </table> 
          <br /> 
          <div class="row"> 
         <div class="small-3 columns"> 
          <div>Sort by: 
    
          <select ng-model="sortExpression"> 
    
            <option value="sort_code">Session Code</option> 
            <option value="pname">Session Title</option> 
            <option value="productNumber">Product Number</option> 
    
           </select> 
          </div> 
    
         </div> 
         </div> 
         <br/> 
          <table border="0"> 
           <thead> 
            <tr> 
             <th>Session Code</th> 
    
             <th>Session Title</th> 
             <th>Product Number</th> 
            </tr> 
           </thead> 
           <tbody> 
            <tr ng-repeat="item in items | orderBy:mySortFunction | filter:search"> 
             <td valign="top"><h3><a href="./publicAccess.php?id={{item.id}}">{{item.product_code}}</a></h3></td> 
    
             <td><h3><a href="./publicAccess.php?id={{item.id}}">{{item.pname}}</a></h3> 
    
             <br/> 
              {{item.speakers}} 
             </p> 
    
             <br/> 
             <h6>{{item.free_viewing}}</h6> 
             </td> 
    
             <td>{{item.productNumber}}</td> 
    
            </tr> 
    
           </tbody> 
          </table> 
    
    
          <br /> 
    </div> 
    </div> 
    
    </div> 
    </div> 
    

    는 데이터 샘플입니다 2013 | A1 | A01 | 제목 이름
  • 2013 이벤트 | 2013 | C10 | C10 | 제목 이름

속은 코드 C10과 C10이 원인 일 수 있습니까?

+0

예, 그게 문제입니다 :

따라서, ADODB와 PHP에서 솔루션이이었다. ng-repeat 표현의 끝에'track by $ index'를 추가하십시오. – m59

+0

나는 그것을 시험해보고 또 다른 오류가있어, 나는 나중에 게시 할 것이다. –

+0

다음과 같이 추가했습니다 : $ track | orderBy : mySortFunction | filter : search ">에 의해 항목 트랙의

답변

0

DB에서 문자 인코딩 문제가 발생했습니다. 명시 적으로 utf8을 요청해야했습니다.

PHP에서 utf_encode를 사용해 보았을 때 좋았습니다.

$this->dsource->Execute("set names utf8"); 
관련 문제