Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
154 views

Hi,

 

I am relatively new to RadEditor Customization. My requirement is as follows.

 

We will have multiple chevrons (i.e. <<>>) placed within the content area. When the user keeps his cursor within the chevron (i.e. “<<Cursor placed Here>>”) a modal dialog should be popped up which contains the text within the chevron (i.e. Cursor placed Here). This text will be displayed within a text box in the modal dialog. Now if the user modifies the text and clicks on insert in the modal dialog then the same text should be replaced within the chevron <<Changed Text>>.

 

Approach followed:

  1. Used the following code to get the bookmark

   var oSel = document.selection.createRange();                                                                                                   

var bookmark = oSel.getBookmark();

  1. I need to get the current cursor position now. Currently I have used

var index = bookmark.charCodeAt(2) - 13;

But I am not sure if this is a currect approach and this is not working properly if the text is formatted. I am not sure why we need to do -13 to get the index but its returning me the current index in case of non formatted text.

Because of this particular approach I have come across the following scenarios

 

Scenario 1: If the content is completely plain then no matter where the chevron is, I am able to get the index Ex. <<Rad>>  ---> in this case if I keep cursor next to R the the I am getting the index as 3

Scenario 2: If there are multiple formatting present in the document then I am unable to find the index properly.  Ex: <<Rad>>  ---> in this case if I keep cursor next to R then I am unable to get the index as 3 and I am getting index as 5. This is because the text is formatted in this case (i.e. the text R is both bold and italics).

 

I need a solution for the same which will work on different browsers. Also the text area can contain formatted text (example: text pasted from word) so I need a help in finding out the current cursor location.

Dobromir
Telerik team
 answered on 10 Dec 2009
2 answers
141 views
Hi,

I need to find a radcombo and update its collection using javascript.

Please check with the coding given below, it showing error message, 'null object' for Radcombo2,

function

 

clientselectedindexchanged(sender,e) // Radcombo1 selected index change

 

 

 {

 

var item = e.get_item();

 

 

 

var comboItem = sender.get_text();

 

 

 

if(comboItem == 'Cancel Episodes')

 

 

 {

 

var combo= $find('<%= Radcombo2.ClientID %>');

 

 

 

 

var

 

comboItem1 = new Telerik.Web.UI.RadComboBoxItem();

 

 

 

 comboItem1.set_text(

'welcome');

 

 

 combo.get_items().add(comboItem1);

comboItem1.select();

 

combo.trackChanges();

 

 

 combo.commitChanges();

 

 

}
}

Please give any suggestion.

Thanks in advance.

Regards,
Utchimahali.N

utchi
Top achievements
Rank 1
 answered on 10 Dec 2009
2 answers
124 views

Hi All,

We have a scheduler,where we place appointments on each of the calender days using drag and drop features from the grid. on click of each appointment ,we show up a customized AdvanceEditForm with controls like combobox and gridview.In this gird view i have a button column ,when ever i click this button an item should get added to the listbox with the edit form still open ... and if i click the update or the submit button the data should be saved and the edit form should close.

I got stucked in adding the item to the listbox when ever i click a button in the gird view and also the click event is getting fired only once it should not be. I am using OnAppointmentCommand,OnFormCreating events...to retirve the values....

This is a crucial requirement. Appreciate any help in this regard.

chaitanya elluri
Top achievements
Rank 1
 answered on 10 Dec 2009
0 answers
165 views
There is a problem with RadScheduler in version 2009.3.1208 (Q3 SP1 2009) if it is bound to Web Service or WCF Service. The problem manifests when you switch the Views. It is already fixed in our latest internal builds (starting from version 2009.3.1210). If you do not want to use the internal bits - please add the following javascript code after the scheduler's declaration:

// Workaround for the view switching bug in RadScheduler (Web Service binding).  
// Should be removed after upgrading to version 2009.3.1210 or later.  
Telerik.Web.UI.RadScheduler.prototype._onWebServiceAppointmentsReceived = function ()  
{  
 this.get_appointments()._clear();  
  
 if (this._newActiveModel)  
 {  
  this._activeModel = this._newActiveModel;  
  this._newActiveModel = null;  
 }  
  
 if (!this._activeModel._getRenderer)  
  return;  
  
 var renderer = this._activeModel._getRenderer();  
 if (renderer)  
 {  
  renderer.refreshView();  
  this._updateScrollAreas();  
 }  
};  

We apologize for the caused inconvenience.

Telerik Admin
Top achievements
Rank 1
Iron
 asked on 10 Dec 2009
5 answers
154 views
I have a panelbar on a usercontrol that fill it's items from an xml file, it has the ExpandMode="SingleExpandedItem".
when I implement the onitemclick server side event with "navpanelBar_ItemClick" event handler the panel stopped expanding ..

Is there a reason for that .

below is the code of this

 

 

<telerik:RadPanelBar ID="navpanelBar" Runat="server"   
    ExpandMode="SingleExpandedItem" Width="100%"   
    OnClientItemClicking="panelclicking" onitemclick="navpanelBar_ItemClick" > 
</telerik:RadPanelBar> 
   
 <script type="text/jscript" language="javascript">  
    function panelclicking(sender, e)  
    {  
        var itemval = e.get_item().get_value();  
        if (!itemval)  
        {e.set_cancel(true);    }  
        else   
        {e.set_cancel(false);}  
    }  
</script> 

Thanks in advance

Waleed Seada
Top achievements
Rank 2
 answered on 10 Dec 2009
1 answer
135 views
By default the column fitlers work in an AND logic.
How can I have the column filters work in an OR logic?
Princy
Top achievements
Rank 2
 answered on 10 Dec 2009
3 answers
108 views
Hi, we have AllowScripts set to true in our radEditor, but no matter what we do, any attempts to insert a simple javascript function get stripped out. Is there a hidden trick to allowing this to happen? Thanks.
Rumen
Telerik team
 answered on 10 Dec 2009
1 answer
97 views
Hi,

I've been trying to figure out an issue that I'm experiencing when using the RadGrid Ajax functionality.

I've followed the implementation pretty similarly to this, using Q3 2009:

Basically, I have a flash object that is being embedded in my RadGrid and when I get a Page size (custom paging) of 50, it is rendering 50 of these flash objects onto my page. This is fine and works in all browsers without ajax. However, when I include the RadAjaxManager so that ajax is being used to go from page to page (with a page size of 50), IE will crash, citing FlDbg9f.ocx as the issue, which is normally associated at least in my searches as overloading the Adobe Flash Player.

If I do NOT use Ajax, this works fine. It also works fine in the latest version of FF and Google Chrome.

Anyway, so it seems to be on the edge functionality-wise, but to me it does not seem that using Ajax should add so much overhead that it would crash with ajax and be fine without it. I saw a post about Rebind possibly getting called multiple times and thought that could be an issue but I couldn't find any concrete information this.

Any help would be appreciated here since I would love to get this working for 50 items, but don't want to put up a warning that if they use IE, it's going to crash their browser.

Thanks,
Chris


Iana Tsolova
Telerik team
 answered on 10 Dec 2009
1 answer
127 views
I have a RadGrid which shows many columns.  Selecting a row causes a client event that writes the record id of the selected row to a cookie.  This works.  Now, I would like to set up a master/details scenario such that below the grid are multiple tabs-- that is, the content displayed below the grid and tabstrip is dependent on both which row in the grid was selected, and also upon which tab is currently selected.  Thus, if the tab selection changes, I would like to dynamically load a usercontrol which should render the content for that tab.  These usercontrols can read the cookie, perform databinding and render themselves.  If the row selection changes, I would similarly like the last loaded control to reload itself.

I have tried a number of things and can't seem to get things right with the page lifecycle and the order in which events fire.  Any suggestions on a general approach?
Yavor
Telerik team
 answered on 10 Dec 2009
1 answer
122 views

Hello,
I have a CardView grid and would like to use in-place editing. In this example nulls are returned to the database rather than the bound values. I can get this to work with editmode in popup or editform but in-place editing would be better. Any thoughts?
 

 
<telerik:RadGridID="RadGrid1"runat="server"DataSourceID="SqlDataSource1" 
GridLines="None">  
<ClientSettings> 
<SelectingAllowRowSelect="true"/>  
</ClientSettings> 
<MasterTableViewAllowPaging="true"DataKeyNames="ID"  
PageSize="1"ShowHeader="False"CommandItemDisplay="Top"TableLayout="Fixed"  
AllowAutomaticInserts="true"AllowAutomaticUpdates="true"EditMode="InPlace">  
<PagerStyleMode="NumericPages"ShowPagerText="False"></PagerStyle>  
<CommandItemTemplate> 
<div> 
<table> 
<tr> 
<td>Docket</td> 
<td><asp:LinkButtonID="LinkButton2"runat="server"CommandName="EditSelected"CssClass="hide4print"><imgstyleimgstyle="border:0px;vertical-align:middle;"alt=""src="Images/editItem.gif"/>EditDocket</asp:LinkButton></td>  
<td><asp:LinkButtonID="LinkButton1"runat="server"CommandName="InitInsert"CssClass="hide4print"><imgstyleimgstyle="border:0px;vertical-align:middle;"alt=""src="Images/newItem.gif"/>AddNewDocket</asp:LinkButton></td>  
</tr> 
</table> 
</div> 
</CommandItemTemplate> 
<ItemTemplate> 
<table> 
<tr> 
<td><asp:LabelID="Label1"runat="server"Text="ID"></asp:Label></td>  
<td><asp:LabelID="Label2"runat="server"Text='<%#Eval("ID")%>'></asp:Label></td>  
</tr> 
<tr> 
<td><asp:LabelID="Label3"runat="server"Text="ID"></asp:Label></td>  
<td><asp:LabelID="Label4"runat="server"Text='<%#Eval("COMPANYNAME")%>'></asp:Label></td>  
</tr> 
<tr> 
<td><asp:LabelID="Label5"runat="server"Text="ID"></asp:Label></td>  
<td><asp:LabelID="Label6"runat="server"Text='<%#Eval("CONTACTNAME")%>'></asp:Label></td>  
</tr> 
</table> 
</ItemTemplate> 
<EditItemTemplate> 
<table> 
<tr> 
<td><asp:LabelID="Label1"runat="server"Text="ID"></asp:Label></td>  
<td><asp:LabelID="Label2"runat="server"Text='<%#Eval("ID")%>'></asp:Label></td>  
</tr> 
<tr> 
<td><asp:LabelID="Label3"runat="server"Text="Company"></asp:Label></td>  
<td><asp:TextBoxID="Textbox1"runat="server"Text='<%#Bind("COMPANYNAME")%>'/></td> 
</tr> 
<tr> 
<td><asp:LabelID="Label5"runat="server"Text="Contact"></asp:Label></td>  
<td><asp:TextBoxID="Textbox2"runat="server"Text='<%#Bind("CONTACTNAME")%>'/></td> 
</tr> 
<tr> 
<td> 
<asp:ButtonID="btnUpdate"Text='<%#IIf((TypeOf(Container)isGridEditFormInsertItem),"Insert","Update")%>'  
runat="server"CommandName='<%#IIf((TypeOf(Container)isGridEditFormInsertItem),"PerformInsert","Update")%>'> 
</asp:Button>&nbsp;  
<asp:ButtonID="btnCancel"Text="Cancel"runat="server"CausesValidation="False"  
CommandName="Cancel">  
</asp:Button> 
</td> 
</tr> 
</table> 
</EditItemTemplate> 
</MasterTableView> 
</telerik:RadGrid> 
 

 

 

 

Thank you.

 

 

Nikolay Rusev
Telerik team
 answered on 10 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?