Hi, I urgently need help, please.
WebtextEdit ClientSideEvent execute javascript statement on mousemove event. I can successfully change the style of another object type on this WebTextEdit ClientSide MouseMove event:document.getElementById("Object2").style.backgroundColor = '#F0F5F7';
But when I want to change the style of the WebTextEdit control:document.getElementById("WebTextEdit1").style.backgroundColor = '#F0F5F7'; Then nothing happens
When I execute the script on the same WebTextEdit Clientside for another object which is not a WebtextEdit:Object2.style.border='1px solid #FFE6A0'; Then it works
But when I want to change the WebtextEdit Clientside style:WebTextEdit1.style.border='1px solid #FFE6A0';
Then I get Error: Can't Eval WebTextEdit1.style.border='1px solid #FFE6A0';
Please Help
Thanks for your reply.
I will try this.
Hi AniLex,
I assume that you ask about image on custom button used by WebTextEditor.
There is no public option to modify image/css of buttons on client. However, javascript object of editor stores all data related to buttons in internal variable _buttons. You may use debugger to find these and other options. Below is example of codes, which changes image of custom button.Note: any side effects of usage internal variables are not supported.
<script type="text/javascript">function changeImg(){ var editor = $find('<%=WebTextEditor1.ClientID%>'); var buts = editor._buttons; // 0-upperspin button, 1-lowerspin button, 2-custom button var but2 = buts[2]; if(!but2) return; var imgElem = but2.imgE, images = but2.img, state = but2._state; //debugger; //alert('currentImg:' + imgElem.src + '\ncurrentState:' + state + '\nstateImages:' + images); var imageNormal = './images/butImg.gif', imageHover = './images/butImgHover.gif'; var imagePressed = './images/butImgPress.gif', imageDisabled = './images/butImgDis.gif'; but2.img = [imageNormal, imageHover, imagePressed, imageDisabled]; imgElem.src = imageNormal; //or better //imgElem.src = but2.img[state];}</script> <input type="button" value="changeImg" onclick="changeImg()" /> <ig:WebTextEditor ID="WebTextEditor1" runat="server"> <Buttons CustomButtonDisplay="OnRight"></Buttons> </ig:WebTextEditor>
How to change the image of WebTextEditControl from javasript?
Thanks,
AniLex
Hi Jorge,
All 3 your emails passed through.
The events on client are based on dot-net ajax framework which supports only 2 params (they mimic corresponding model on server). The 1st param is reference to owner/sender (WebTextEditor) and second param is eventArgs. In case of TextChanged event it is instance of Infragistics.Web.UI.TextEditorTextChangedEventArgs class. It has 2 methods (they are considered "properties" by dot-net-ajax rules): get_text() and get_oldText().
To learn available features on client model, I suggest you to look at docs or you may find them directly in debugger. Under IE the debugger window will show you all members of an object. So, you may insert "debugger;" line in your handler and check methods of second param.
Hi Viktor
I was wondering how could I get the old text from the event TextChanged from the AJAX component "WebTextEditor" that only has two parameter (sender, e). I want to do something similar to the non ajax component WebTextEdit that provides a parameter with the old value.
I have been trying to ask this twice, but the for some reason the forum is not working properly with mozilla 3.6.2. Hope you get this one from IE :)
Many Thanks
Jorge from ANS