Hi,Version 11.1, IE9, I want to raise / decrease the value of the editor on clicking the buttons of the WebNumericEditor with5 (int). So:
<
>and a smal script:<script id="igClientScript" type="text/javascript"><!--function RaiseFive() { var editor = igedit_getById("WnDstartM");var Waarde = editor.getValue() + 5;editor.ValueInt = Waarde;}// --></script> but no response? Perhaps wrong way to SET the value???
Friendly greeting,
Hi, Jurgen.
Maybe I will need more clarification about your problem, because it's possible that I understood you in the wrong way. Sorry if this is the case.
If you are asking about how to attach to client-side events, see the code below.
In the markup you need to use ClinetEvents tag:
<ig:WebNumericEditor ID="BasicNumericEditor" runat="server">
<ClientEvents Spin="BasicNumericEditor_Spin"
KeyDown="BasicNumericEditor_KeyDown"
KeyUp="BasicNumericEditor_KeyUp"/>
</ig:WebNumericEditor>
and in the JavaScript you need to define the handler function:
function BasicNumericEditor_KeyUp(e, args){
var editor = $find("<%= this.BasicNumericEditor.ClientID %>");
var Waarde = editor.get_value() + 5;
editor.set_value(Waarde);
}
If you are saying that inside the 'BasicNumericEditor_KeyUp' handler you are not able to access the Numeric Editor object and it's methods, I'm able to access them and the code is working. So if you want to me investigate your problem, you can give your code that is not working and I will try fix it.
Best regards,
Nikolay
Hi,I can get the script to work when I trigger it on 'ClientEvents-Spin' but I can't distinguish UP from DOWN that way. And when I use 'ClientEvents-KeyUp' I'll get no response.So can you please tell me the right even name.Friendly greetings,Jurgen
Hi, guy(s) from onnitelenet.be.
I see that you are using some wrong method names. The method name for getting the value is get_value(), with underscore. The corresponding method for setting the value is set_value() and you should pass the new value as a parameter. Also if for some reason igedit_getById("WnDstartM") is not finding the control, you can always use the global search method $find(). So the code that is working on my machine is the following:
// var editor = igedit_getById("WnDstartM");
var editor = $find("<%= this.WnDstartM.ClientID %>");
I hope this will help you and if you have some additional questions I will be happy to answer you.
Nikolay Alipiev