如何在 telerik mvc 组合框中为特定索引的列表项提供阴影



代码:

  @( 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
   }

打开组合框时,如何为Telerik mvc组合框中特定索引(2)的列表项提供阴影(默认橙色)。

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

function oncmbTestOpen(e){
  var index = 2;
  var $li = $(this).data('tComboBox').dropDown.$items.eq(index);
  //$li.css('color', 'red');
}

最新更新