In numeric edit if you have to get the text box value and do some client side validation..and set some new values...the event we need to target is the _ValueChange. The in built functions are
getValue() and SetValue()
script id="igClientScript" type="text/javascript"
function wneHour_ValueChange(oEdit, oldValue, oEvent){
var newValue = oEdit.getValue();
var a = true;
if(newValue < 1)
{
oEdit.setValue("1");
a = false;
}
if(newValue > 12)
{
oEdit.setValue("12");
a = false;
}
if(newValue > 0 && newValue < 10)
{
var leadingzero = "0";
var newtext = leadingzero + newValue;
oEdit.setValue(newtext);
}
//Not calling this event will create a postback
oEvent.cancel = true;
}
// -->
/script
Showing posts with label Infragistics. Show all posts
Showing posts with label Infragistics. Show all posts
Tuesday, June 10, 2008
Infragistics Web Panel
I had to recently implement infragistics web panel. Web panel Infragistics has two client side events, ExpandStateChanging and ExpandStateChanged
If you have to do some simple client side validation on web panels say for example expand one web panel and collapse the rest on the page...without posting back, the key is:
A simple thing..but since it was new, i was searching for while and as they say, if you don't know something..you have to RTFM.. thts exactly what i did and used some commonsense too..
igpnl_getPanelById('<%= household_panel.ClientID %>').setExpanded(false);
where igpnl_getPanelById is an inbuilt infragistics function to find the control.
The regular document.getElementById does not work.
The event setExpanded expands (true) or collapses (false).
script id="igClientScript" type="text/javascript"
function general_panel_ExpandedStateChanging(oWebPanel, oEvent)
{
igpnl_getPanelById('<%= h_panel.ClientID %>').setExpanded(false);
igpnl_getPanelById('<%= e_panel.ClientID %>').setExpanded(false);
igpnl_getPanelById('<%= a_panel.ClientID %>').setExpanded(false);
igpnl_getPanelById('<%= pro_panel.ClientID %>').setExpanded(false);
if (oWebPanel.getExpanded() == true)
document.getElementById('<%= general_panel.ClientID %>').title = "Click arrow to the right to expand and close this description.";
else
document.getElementById('<%= general_panel.ClientID %>').title = "";
//Not calling this will do a postback to the server..
oEvent.cancelPostBack = true;
}
// -->
/script
If you have to do some simple client side validation on web panels say for example expand one web panel and collapse the rest on the page...without posting back, the key is:
A simple thing..but since it was new, i was searching for while and as they say, if you don't know something..you have to RTFM.. thts exactly what i did and used some commonsense too..
igpnl_getPanelById('<%= household_panel.ClientID %>').setExpanded(false);
where igpnl_getPanelById is an inbuilt infragistics function to find the control.
The regular document.getElementById does not work.
The event setExpanded expands (true) or collapses (false).
script id="igClientScript" type="text/javascript"
function general_panel_ExpandedStateChanging(oWebPanel, oEvent)
{
igpnl_getPanelById('<%= h_panel.ClientID %>').setExpanded(false);
igpnl_getPanelById('<%= e_panel.ClientID %>').setExpanded(false);
igpnl_getPanelById('<%= a_panel.ClientID %>').setExpanded(false);
igpnl_getPanelById('<%= pro_panel.ClientID %>').setExpanded(false);
if (oWebPanel.getExpanded() == true)
document.getElementById('<%= general_panel.ClientID %>').title = "Click arrow to the right to expand and close this description.";
else
document.getElementById('<%= general_panel.ClientID %>').title = "";
//Not calling this will do a postback to the server..
oEvent.cancelPostBack = true;
}
// -->
/script
Subscribe to:
Posts (Atom)