I've got an app that uses the panelbar to display different grids of data. Some of our users like to use keyboard shortcuts to expand and collapse the panel items. So I created a small Javascript function attached to the OnClientItemFocus to accomplish this:
Here's the problem - a mouseclick also focuses on the item, but has it's own event that expands or collapses the panel item. So what I get when I click it with a mouse is, it expands just fine, but when I click again to collapse it collapses and expands again. I've tried using the "stopProgagation" method on the domEvent in the ItemClicked and ItemClicking client-side events, but that doesn't help. What I think I need is a way to differentiate between a mouseclick and key press in the client-side event so I can handle them differently. Unless there's an easier way?
All I really want to do its allow users to expand or collapse panelbar items when they click on them, or if they use a keyboard shortcut to select them. Is that possible with RadPanelBar?
Thanks for the help!
function focusItem(panelbar, args) { |
var item = args.get_item(); |
if (item.get_level() == 0) { |
// item.click(); |
if(item.get_expanded()) item.collapse(); |
else item.expand(); |
} |
} |
All I really want to do its allow users to expand or collapse panelbar items when they click on them, or if they use a keyboard shortcut to select them. Is that possible with RadPanelBar?
Thanks for the help!