2016-05-17 55 views
0

我嘗試插入下面的方式gridster項目屬性:應該在哪裏插入屬性gridster-item?

<div class="myTile" gridster-item= "tile" row="0" col="0" ng-repeat="tile in selectedTiles" > 
    <ul class="dropdown-menu"> 
    <li><a href="#" 
       id="gridster-form" 
       role="button" 
       aria-labeledby="Gridster Layout Form"> 

       <span class="dropdown-text"> 
        Col <input type="text" value="tile.col" integer ng-model="tile.col" size="1" class="ng-scope ng-pristine ng-untouched ng-valid"> 
        Row <input type="text" value="tile.row" integer ng-model="tile.row" size="1" class="ng-pristine ng-untouched ng-valid">  
       </span> 
       <i class= "fa fa-arrows"></i> 
    </a></li> 
    </ul> 
</div> 

基本上當我把gridster項,輸入字段會正確地tile.col和tile.row性能佔據(沒有它他們沒有出現)。

問題當我插入gridster-item屬性時,它會將我的圖塊引發到dom上的隨機點。這告訴我即使沒有正確使用它。有什麼建議麼?

+0

那不是與你專門設置了'row'和'col'爲0? –

回答

0

嘗試使用outher DIV,把NG-重複上:

<div ng-repeat="tile in selectedTiles"> 
    <div class="myTile" gridster-item= "tile" row="0" col="0" > 
     <ul class="dropdown-menu"> 
     <li><a href="#" 
        id="gridster-form" 
        role="button" 
        aria-labeledby="Gridster Layout Form"> 

        <span class="dropdown-text"> 
         Col <input type="text" value="tile.col" integer ng-model="tile.col" size="1" class="ng-scope ng-pristine ng-untouched ng-valid"> 
         Row <input type="text" value="tile.row" integer ng-model="tile.row" size="1" class="ng-pristine ng-untouched ng-valid">  
        </span> 
        <i class= "fa fa-arrows"></i> 
     </a></li> 
     </ul> 
    </div> 
</div>