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:
var oSel = document.selection.createRange();
var bookmark = oSel.getBookmark();
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.
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
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.
| // 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(); |
| } |
| }; |
| <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

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> |
| <asp:ButtonID="btnCancel"Text="Cancel"runat="server"CausesValidation="False" |
| CommandName="Cancel"> |
| </asp:Button> |
| </td> |
| </tr> |
| </table> |
| </EditItemTemplate> |
| </MasterTableView> |
| </telerik:RadGrid> |
Thank you.