【问题标题】:Where should the attribute gridster-item be inserted?属性 gridster-item 应该插入到哪里?
【发布时间】:2016-05-17 03:11:45
【问题描述】:

我尝试通过以下方式插入 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-item 时,输入字段被 tile.col 和 tile.row 属性正确占据(没有它它们不会显示)。

问题 当我插入 gridster-item 属性时,它会将我的图块扔到 dom 上的随机位置。这告诉我我没有正确使用它。有什么建议吗?

【问题讨论】:

  • 这与您将rowcol 设置为0 无关吗?

标签: javascript jquery html angularjs gridster


【解决方案1】:

尝试使用外部 div 并将 ng-repeat 放在上面:

<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>

【讨论】:

    猜你喜欢
    • 2020-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-25
    • 1970-01-01
    • 2018-08-14
    相关资源
    最近更新 更多