Is it possible to not set the window behaviors all in one statement? I have a series of hidden form values that dictate whether the window should have reload or close or move options, but it's creating a nested if() nightmare. Can I somehow do radWnd.set_behaviors = radWnd.set_behaviors + radWnd.set_behaviors(x)?
I've also tried creating a string and setting it that way, which resulted in the window having no behaviors at all.
I've also tried creating a string and setting it that way, which resulted in the window having no behaviors at all.
| var hidShowCloseButton = getElementId(_strCPId + 'hidShowCloseButton'); |
| var hidHideReloadBtn = getElementId(_strCPId + 'hidHideReloadBtn'); |
| var hidWindowBehaviorMove = getElementId(_strCPId + 'hidWindowBehaviorMove'); |
| var strBehaviors = ""; |
| var strTelerik = "Telerik.Web.UI.WindowBehaviors."; |
| strBehaviors = strTelerik + "None"; |
| if (hidShowCloseButton != null) { |
| strBehaviors += " + " + strTelerik + "Close"; |
| } |
| if (hidWindowBehaviorMove != null) { |
| if (hidWindowBehaviorMove.value == "true") { |
| strBehaviors += " + " + strTelerik + "Move"; |
| } |
| } |
| if (hidHideReloadBtn != null) { |
| if (hidHideReloadBtn.value == "true") { |
| strBehaviors += " + " + strTelerik + "Reload"; |
| } |
| } |
| radWnd.set_behaviors(strBehaviors); |