Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
259 views
Hi.

I have a page that uses a RadWindow to insert symbols into a content page.

When a symbol in the RadWindow is clicked, an OnClick function is called. In the OnClick function, the BrowserWindow is called from which the Javascript function InsertC(symbol) is called. The html code of the radwindow looks like this:
 
<!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><link rel="stylesheet" type="text/css" href="Common/Styles.css" /> 
<script language="javascript" type="text/javascript" > 
    function GetRadWindow() { 
        var oWindow = null
        if (window.radWindow) 
            oWindow = window.radWindow; 
        else if (window.frameElement.radWindow) 
            oWindow = window.frameElement.radWindow; 
        return oWindow; 
    } 
 
    function Click(symbol) { 
        var curWin = GetRadWindow(); 
        var bw = curWin.BrowserWindow;         
        bw.insertC(symbol); 
    } 
</script> 
    <title> 
 
</title></head
<body> 
    <div id="Symbol_div"
     
<table id="Symbol_div_table" cellpadding="0" cellspacing="0" class="symbolTable"
        <tr> 
 
            <td onclick="Click('α');" align="center"><div style="width:25px; height:25px;" onmouseout="this.style.backgroundColor = '#fff';" onmouseover="this.style.backgroundColor = '#22f';"<a  class="rtbWrap" href="#"><span style="width:100%; height:100%" ><span class="rtbIcon">&alpha;</span></span></a></div></td> 
            <td onclick="Click('β');" align="center"><div style="width:25px; height:25px;" onmouseout="this.style.backgroundColor = '#fff';" onmouseover="this.style.backgroundColor = '#22f';"<a  class="rtbWrap" href="#"><span style="width:100%; height:100%" ><span class="rtbIcon">&beta;</span></span></a></div></td> 
            <td onclick="Click('γ');" align="center"><div style="width:25px; height:25px;" onmouseout="this.style.backgroundColor = '#fff';" onmouseover="this.style.backgroundColor = '#22f';"<a  class="rtbWrap" href="#"><span style="width:100%; height:100%" ><span class="rtbIcon">&gamma;</span></span></a></div></td> 
            <td onclick="Click('Ï€');" align="center"><div style="width:25px; height:25px;" onmouseout="this.style.backgroundColor = '#fff';" onmouseover="this.style.backgroundColor = '#22f';"<a  class="rtbWrap" href="#"><span style="width:100%; height:100%" ><span class="rtbIcon">&pi;</span></span></a></div></td> 
            <td onclick="Click('ω');" align="center"><div style="width:25px; height:25px;" onmouseout="this.style.backgroundColor = '#fff';" onmouseover="this.style.backgroundColor = '#22f';"<a  class="rtbWrap" href="#"><span style="width:100%; height:100%" ><span class="rtbIcon">&omega;</span></span></a></div></td> 
        </tr> 
 
        <tr> 
            <td onclick="Click('δ');" align="center"><div style="width:25px; height:25px;" onmouseout="this.style.backgroundColor = '#fff';" onmouseover="this.style.backgroundColor = '#22f';"<a  class="rtbWrap" href="#"><span style="width:100%; height:100%" ><span class="rtbIcon">&delta;</span></span></a></div></td> 
            <td onclick="Click('φ');" align="center"><div style="width:25px; height:25px;" onmouseout="this.style.backgroundColor = '#fff';" onmouseover="this.style.backgroundColor = '#22f';"<a  class="rtbWrap" href="#"><span style="width:100%; height:100%" ><span class="rtbIcon">&phi;</span></span></a></div></td> 
            <td onclick="Click('θ');" align="center"><div style="width:25px; height:25px;" onmouseout="this.style.backgroundColor = '#fff';" onmouseover="this.style.backgroundColor = '#22f';"<a  class="rtbWrap" href="#"><span style="width:100%; height:100%" ><span class="rtbIcon">&theta;</span></span></a></div></td> 
            <td onclick="Click('κ');" align="center"><div style="width:25px; height:25px;" onmouseout="this.style.backgroundColor = '#fff';" onmouseover="this.style.backgroundColor = '#22f';"<a  class="rtbWrap" href="#"><span style="width:100%; height:100%" ><span class="rtbIcon">&kappa;</span></span></a></div></td> 
        </tr> 
    </table> 
 
 
</div> 
</body> 
</html> 
 


The function InsertC, located in a separate javascript file, looks like this:
function insertC(c) { 
    if (document.selection) { // IE 
        var rng = document.selection.createRange(); 
        rng.text = c; 
        rng.select(); 
    } 
    else { //Firefox 
        var sel = document.getSelection(); 
        var range = window.getSelection().getRangeAt(0); 
        range.deleteContents(); 
        range.insertNode(document.createTextNode(c)); 
    } 


In firefox is works as expected. In internet explorer, the problem is this:
  • after opening the radwindow, the focus is set to the radwindow.
  • Clicking on a symbol, it is inserted inside the RadWindow, and not in the content page.
  • Clicking on the content page restores focus. Clicking on symbols in the radwindow now works as expected, they are inserted on the content page. But: clicking inside the radwindow, somewhere other than on a symbol, sets focus to the radwindow again.
I would like for the radwindow to never get focus, or for the insertC function to only insert text in the content page. I already tried replacing   document.selection.createRange(); with form1.selection.createRange(); , and some other things, but the result was the same.

Thankful for any help.
Fredrik


Mallverkstan
Top achievements
Rank 2
 answered on 24 Nov 2008
1 answer
98 views
Hi

When I set in grid :

<telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete"  ImageUrl="img/Delete16.gif"                                                    ButtonType="ImageButton"
CommandName="Delete"  >
<ItemStyle Width="20px" />
</telerik:GridButtonColumn>

<ClientSettings EnableRowHoverStyle="True" AllowRowsDragDrop="True" >
 <ClientEvents OnCommand="Test" />
</ClientSettings>

... and I call Test like :

function Test(sender, args)

 var command = args.get_commandName();
 if (command == "Delete")
 { 
  var rowNo = args.get_commandArgument() ;
  alert(rowNo);
}
I cannot get row number.

But if I set :

<telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete"     
CommandName="Delete"  >
<ItemStyle Width="20px" />
</telerik:GridButtonColumn>

<ClientSettings EnableRowHoverStyle="True" AllowRowsDragDrop="True" >
 <ClientEvents OnCommand="Test" />
</ClientSettings>

without ImageButton style, everything works good and I can get row number. Why ??

Regards
Krzysztof
Vlad
Telerik team
 answered on 24 Nov 2008
4 answers
144 views
I have a strange problem with the menu control. I have a menu into my website and whien I resize the browser, the Menu can disappear. I don't know why ... My menu move when I resize the brower to be entirely visible. I would like that my menu be fix and I think that it could resolve my problem.  Is it possible to fix the menu ? I don't want to have a menu on serveral lines if the browser is small.

Thank you in advance,

Suzi
Top achievements
Rank 1
 answered on 24 Nov 2008
8 answers
268 views
I have a TreeView inside a ComboBox that loads its nodes from SQL Server on demand.

 

<

telerik:RadComboBox ID="cbRange" runat="server" >
    <ItemTemplate>
        
<div id="div1">
            <telerik:RadTreeView runat="server" ID="rd" NodeExpand="rd_NodeExpand" OnClientNodeClicking="cbNodeClicking">
            
</telerik:RadTreeView>
        
</div>
</ItemTemplate>
    <Items>
        <telerik:RadComboBoxItem Text="" />
    </Items>
</telerik:RadComboBox>

 function cbNodeClicking(sender, args)
        {
            var comboBox = $find("<%= cbRange.ClientID %>");
          
            var node = args.get_node();
           
            if(node.get_level()<2)
            {
                SomeHtmlInputControl.value = "";
                comboBox.set_text("");
            }
            else
            {
                SomeHtmlInputControl.value = node.get_value();
                comboBox.set_text(node.get_text());
            }
            comboBox.hideDropDown();
        }

After installing the latest 2008.Q1 release of the contros, I get this strange behaviour: The very first time I select a node, regardless of its level, I get all first level nodes text combined, as the text set in the combobox! After that, each time I select a node, either the empty string (for level less than 2) or the node text is set as the ComboBox text, which is the correct behaviour.

Why is that?
 

Veselin Vasilev
Telerik team
 answered on 24 Nov 2008
1 answer
130 views
Dear All,

I am using a splitter control. in which i have taken a grid. when i am giving the height and width of this grid in pixels then it is not flickerinmg, but if i give width in %age then it is flickering. and how to give height to 100%(means height of screen)

Does anybody know, plz tell me how to remove this.


Thanks & Regards
Brijendra Pandey
Svetlina Anati
Telerik team
 answered on 24 Nov 2008
3 answers
133 views
After switching to the prometheus editor, all of my validators no longer work. I get the error message:

Control '...' referenced by the ControlToValidate property of '...' cannot be validated.

Is there a workaround for this?

James
Rumen
Telerik team
 answered on 24 Nov 2008
1 answer
166 views

Hi all,

  1. I have page (page1) which contains a RadWindowManager with 2 configured RadWindows.
  2. On page1 I can click a button which gets an instance of the manager and calls RadWindowManager.Open to open my first popup page (popup1).
  3. On popup1  I can click a button which gets the instance of the manager and calls RadWindowManager.Open to open my second popup page (popup2).

All this works fine but would like to know how I can pass values between popup1 and popup2. Do I have to scrap using the manager and open each RadWindow with radopen?

 I have read the article ‘Returning Values From a Dialog’ and based my code around this using 3 pages (2 popups) rather than your 2 pages with one as a pop up example. I can create and populate popup1.argumants and pass them back to page1 but cannot accomplish this from popup1 to popup2.

Any help on this one would be much appreciated

Many thanks

Tim

tbrown
Top achievements
Rank 1
 answered on 24 Nov 2008
1 answer
116 views
Hi,

I am trying to download following from editor:

   dfg   dfg        

I get:
 Â  dfg Â  dfg Â Ã‚ Ã‚ Ã‚ Ã‚ Ã‚ Ã‚


i.e. space and tabs are replaced by Â

Any idea why this happens?

Regards,
Vaibhav







Rumen
Telerik team
 answered on 24 Nov 2008
3 answers
125 views
I am using one google like filtering for grid.
now when i am clicking on the column filters, it is taking a postback and page_load is firing.
How can i check whether the postback is AJAX or not ?

please help me, it is urjent
Vlad
Telerik team
 answered on 24 Nov 2008
1 answer
90 views
hello
This is a really bizarre problem...

I have a standard <asp Linkbutton> on my form. It is wired to update an UpdatePanel when clicked. The panel it is supposed to update, contains a RadGrid. When the page first loads, the linkbutton is totally dead, clicking on it does nothing. However, if I click on a column header on the grid, the RadGrid resorts properly. Then when the page reloads, the once dead button, is now clickable! I've saved the source code to the page, before it worked and after it works. I've then compared them using the Beyond Compare VDiff tool, they are exactly the same! Why would the button not be clickable unitl the page is reloaded via the RadGrid resort?

Very weird!
Thanks
Harold
Vlad
Telerik team
 answered on 24 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?