Hi,
I've created a SharePoint web part for WSS 3.0 that displays a panel bar similar to one i created in an aspx page. The problem I'm having is that after I've registered a client script block, the script I was using previously to capture what panel was selected, and then close all the others no longer works. Previously I had the script triggered using OnClientItemClicked on the client side in the aspx page. Since web parts are only server side, I've added an attribute to the RadPanelbar of onclick to trigger the script below. Does anyone know why the script below doesn't work?
Thanks!
I've created a SharePoint web part for WSS 3.0 that displays a panel bar similar to one i created in an aspx page. The problem I'm having is that after I've registered a client script block, the script I was using previously to capture what panel was selected, and then close all the others no longer works. Previously I had the script triggered using OnClientItemClicked on the client side in the aspx page. Since web parts are only server side, I've added an attribute to the RadPanelbar of onclick to trigger the script below. Does anyone know why the script below doesn't work?
<script> |
function onclick(sender, args) { |
var selectedtext = args.get_item().get_text(); |
var panelBar = $find("<%= RadPanelBar1.ClientID %>"); |
//close all other panels when item is clicked |
var panelItem = panelBar.findItemByText("panel1"); |
panelItem.collapse(); |
panelItem.blur(); |
panelItem = panelBar.findItemByText("panel2"); |
panelItem.collapse(); |
panelItem.blur(); |
panelItem = panelBar.findItemByText("panel3"); |
panelItem.collapse(); |
panelItem.blur(); |
panelItem = panelBar.findItemByText("panel4"); |
panelItem.collapse(); |
panelItem.blur(); |
panelItem = panelBar.findItemByText(selectedtext); |
panelItem.expand(); |
panelItem.focus(); |
} |
</script> |
Thanks!