0

Code:

  @( Html.Telerik().ComboBox()
    .Name("cmbTest")
    .ClientEvents(events => events
                    .OnOpen("oncmbTestOpen")
                )
    )

   function oncmbTestOpen(e)
   {
        var index = 2;
        // How to give the shade(default orange color) to the list item of particular index(2) in the telerik mvc combo box
   }

How to give the shade(default orange color) to the list item of particular index(2) in the telerik mvc combo box when opening the combo box.

4

1 回答 1

0

您可以通过以下方式访问 li 元素:

function oncmbTestOpen(e){
  var index = 2;
  var $li = $(this).data('tComboBox').dropDown.$items.eq(index);
  //$li.css('color', 'red');
}
于 2012-11-21T21:39:55.300 回答