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
You want to use the CSOM of the WebTextEdit, rather than just the JavaScript DOM. The WebTextEdit object you get from one of the client-side events is a JavaScript object, but not directly an HTML element. The object does not directly have a "style" property, which is why you get this error.
The style properties, including borders, are off the Element property of the WebTextEdit control itself.
function WebTextEdit_MouseMove(oEdit, text, oEvent){ oEdit.Element.style.backgroundColor = '#F0F5F7';}
Please remember that this is a peer-to-peer forum. We'll post answers when and as we can, but we may not be able to handle "urgent" issues so quickly. For official assistance from Infragistics, particularly for urgent issues, you should likely submit a support request instead of using the forums.
Thank You for your kindness, patience & help.
Please Assist, I can't get it going: on the WebTextEdit Object (FG1010NItemD) - ClientSideEvent - MouseOver:
I tired inserting the following javascript within the MouseOver property:
FG1010NItemD.Element.style.backgroundColor = '#F0F5F7';
oEdit.FG1010NItemD.style.backgroundColor = '#F0F5F7';
oEdit.Element.style.backgroundColor = '#F0F5F7';
Aplogies for being a nuisance but please assist as I don't really know how to do this.
Please Assist!
This line of code, in the MouseOver event handler of your WebTextEdit, shoudl have changed its background color:
If that didn't do it, then there's something I'm missing. Perhaps there's an error on your page preventing this event from occurring? It's likely that you'll want to submit a support request as I'd mentioned above so that we can look into what you're doing more directly. If you can include a sample project that we can run and debug which shows what you're doing with the WebTextEdit so far, that'll help ensure that we're using the same code you are.
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