0

以下は、UI選択を実装しているコードです。要素を調べて Id を取得し、以下の HTML 要素を取得しました:

 .ui-select-choices-row-0-0{
   pointer-events: none;
  }
 So for the first time it is working fine. But when i navigate to 
 some other page and again coming to the Ui select then due to rendereing
 id is getting changed(.ui-select-choices-row-1-0)
 (.ui-select-choices-row-2-0). So second time it is not working.
 Is there any solution for that?

<div id="ui-select-choices-row-0-0" class="ui-select-choices-row ng-scope" role="option" 
ng-class="{active: $select.isActive(this), disabled: $select.isDisabled(this)}" 
ng-repeat="item in $select.items track by $index" 
ng-if="$select.open" 
ng-mouseenter="$select.setActiveItem(item)" 
ng-click="$select.select(item,false,$event)">
<a class="ui-select-choices-row-inner" href="javascript:void(0)" uis-transclude-append="">
<span class="ng-binding ng-scope" ng-bind-html="trustAsHtml((item))">--------------</span>
</a>
</div>

<ui-select ng-model="$parent.model"
             name="{{name}}"
             id="{{name}}"
             theme="bootstrap"
             ng-required="{{isRequired}}"
             on-select="updateItem($item, $model)">
    <ui-select-match placeholder="Enter 2 or more characters">
      <div>
        {{$select.selected}}
        <button class="btn btn-xs clear btn-right" ng-click="clear($event)"><i class="fa fa-remove"></i></button>
      </div>
    </ui-select-match>
    <ui-select-choices repeat="item in data track by $index"
                       refresh="refreshData($select.search)"
                       refresh-delay="100">
      <span ng-bind-html= "trustAsHtml((item))"></span>
    </ui-select-choices>
  </ui-select>

4

1 に答える 1

0
Actually I had set of frequently used currency that i was sending from backend
and with currencies i also sent "-------------". So now in UI select data is
like : Frequently used currency->"----------" -> then all the currencies.
So what i did i inspect the element and took the HTML generated from that.
and applied below css on that class:

.ui-select-choices-row:nth-child(38){
   pointer-events: none;
   background-color: #d3d3d3;
 }

Now it is working fine but one thing is that i have noticed, that element  
"---------------" is on 35th number. But if i have written CSS for 35th 
element it is not working. I used nth-child(38) then it is working.

しかし、それでもUI選択でセパレーターを作成する方法を知りたいですか??

于 2016-02-11T19:29:06.000 に答える