I have a webnumericedit that is set to enable='false'. I want to enable it by javascript like this:
function Enable_wne(oEdit, oldValue, oEvent){ var wnecontrol= document.getElementById('<%= wnecontrol.ClientID%>'); wnecontrol.disabled=false;}
Hi,
The method is setEnabled passing in a boolean valule.
so to disable wnecontrol.setEnabled(false)
to enble wnecontrol..setEnabled(true)
Here is a help link
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.1/CLR3.5/html/WebNumericEdit_Object_CSOM.html
Hello,
I tried the setEnabled function and it did not worked. When I check the value by alert(controle.disabled); I get the correct value but on screen it's still disabled
Hi ,
I wrote a little javascript routine that disables and enables the WebNumericedit.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register assembly="Infragistics2.WebUI.WebDataInput.v8.3, Version=8.3.20083.2068, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.WebDataInput" tagprefix="igtxt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title>
<script type="text/javascript" ><!--var Edit = null;function WebNumericEdit1_Initialize(oEdit, text){ //Add code to handle your event here. Edit = oEdit; }function button_click(){debugger;var b = Edit.getEnabled() if (b) { Edit.setEnabled(false); } else { Edit.setEnabled(true); }}// --></script></head><body> <form id="form1" runat="server"> <div> <igtxt:WebNumericEdit ID="WebNumericEdit1" runat="server"> <ClientSideEvents Initialize="WebNumericEdit1_Initialize" /> </igtxt:WebNumericEdit> <input id="Button1" onclick="button_click()" type="button" value="button" /></div> </form></body></html>
How to find the control within the cell, to make it enabled/disabled?
Nice sample, i also want to enable/disable a NumericEditor within a WebDataGrid in a cell. The cell i also have selected, but how to get the control from the cell the disable/enable it?
On server side i disabled the Numeric control and the can´t set any value. Now i will enable this Control with Javascript to make changes. Here is my code:
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="400px" Width="98%" AutoGenerateColumns="false" EnableDataViewState="True" EnableAjax="false" DataKeyFields="Id"> <Columns>
<ig:TemplateDataField Key="NotSalable" Width="150" > <ItemTemplate> <div id="divNotSalable"> <ig:WebNumericEditor ID="nudNotSalableNumber" runat="server" DataMode="Int" MaxDecimalPlaces="0" ValueInt='<%# Bind("NotSaleableNumber") %>' Width="50px" MinValue="0" MaxValue="500"> <Buttons SpinButtonsDisplay="OnRight"> </Buttons> </ig:WebNumericEditor> </div> </ItemTemplate> </ig:TemplateDataField>
I tried in my javascript function this, but the clientId within a grid couldn´t be resolved.
function Test()
{
// var grid = $find("WebDataGrid1"); // my DataGrid has an Id of WebDataGrid1 var grid = $find("<%= WebDataGrid1.ClientID %>"); var rows = grid.get_rows(); var currentIndex = document.getElementById('<%=hfRowIndex.ClientID %>').value; var row = rows.get_row(currentIndex); // 1 = your row index var cell = row.get_cell(4); // 0 = your cell index
var isChecked = src.checked; if (isChecked) { // cell.get_element().style.visibility = 'hidden'; cell.get_element().getElementsByTagName('<%=nudNotSalableNumber.ClientID %>');
}
..