Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1060
The WebDropDown load on demaind feature doesn't load next items on down arrow key press
posted

The WebDropdown (13.1.20131.2107) will load the next set of items when you are near the end of the list of currently loaded items, and use the mouse to click down.

However, if you use the down arrow key to scroll through the end, and reach the end of the currently loaded items, then further presses of the down arrow key do not load more items, but I think they should - if there are items to load...

The infragistics sample for the webdropdown load on demand feature demonstrates this behaviour.

Is there some simple way to make it load the next items on the arrow key press?

Parents
  • 1060
    Suggested Answer
    Offline posted

    I came up with a workaround. I handle the keydown on the combo and check the keycode:

    case 40: // down arrow
      if (combo.get_enableLoadOnDemand())
      {
        var activeItemIndex = combo.get_activeItemIndex();
        if (activeItemIndex)
        {
          var count = combo.get_items().getLength();
          if (count && activeItemIndex === (count - 1))
          {
            // The active item is the last item in the list and the 
            // down arrow is pressed,
            // trigger load on demand
    combo.selectItemByIndex(activeItemIndex, true, true);
            combo._elements['DropDownContents'].scrollTop += 1
            combo._scrollingLoadOnDemand();
            return false;
          }
        }            
      }

    Edit: added the selectItemByIndex which means that the last item in the list will be reselected after the postback.

Reply Children
No Data