Welcome Guest Search | Active Topics | Sign In | Register

EO grid edit changes when a spellcheck dialog is opened Options
abzil
Posted: Friday, October 21, 2011 2:05:15 AM
Rank: Newbie
Groups: Member

Joined: 1/16/2011
Posts: 5
On edit mode of the grid in one of the column I having spellcheck control associated with a textbox. When I click the spellcheck button the clientsideendedit event is fired

Please let me know how to resolve this issue

This works with previous EO.Web.dll


This is a sample page

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="test_Default" %>

<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>

<!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">

<script language="javascript" type="text/javascript" >

function on_begin_edit1(cell) {
//Get the current cell value
var v = cell.getValue();
if (v == null)
v = '';
//Load the value into our drop down box
var txtBox = document.getElementById("txt_RequestDetail");

txtBox.value = v

}

function on_end_edit1(cell) {
//Get the new value from the drop down box
alert("ff");
var txtBox = document.getElementById("txt_RequestDetail");
var v = txtBox.value;


return v;

}

</script>

<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<eo:Grid ID="grdRequirements" runat="server"
BorderColor="#999999" BorderWidth="1px"
ColumnHeaderAscImage="00050104" ColumnHeaderDescImage="00050105"
ColumnHeaderDividerImage="00050103" FixedColumnCount="1" Font-Bold="False"
Font-Italic="False" Font-Names="Tahoma" Font-Overline="False"
Font-Size="8.75pt" Font-Strikeout="False" Font-Underline="False"
GoToBoxVisible="True" GridLineColor="220, 223, 228" GridLines="Both"
Height="257px" Width="766px" ItemHeight="60"
ClientSideOnItemCommand="OnItemCommand" AllowNewItem="True" >
<FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
<ContentPaneStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;" />
<GoToBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; BORDER-TOP: #7f9db9 1px solid; BORDER-LEFT: #7f9db9 1px solid; WIDTH: 40px; BORDER-BOTTOM: #7f9db9 1px solid" />
<ColumnHeaderStyle CssText="background-image:url('00050101');padding-left:8px;padding-top:3px;" />
<ItemStyles>
<eo:GridItemStyleSet>
<ItemStyle CssText="background-color: white" />
<ItemHoverStyle CssText="background-color: whitesmoke" />
<SelectedStyle CssText="background-color:silver;color:white;" />
<EditSelectedStyle CssText="width: 50px" />
<FixedColumnCellStyle CssText="border-right: #d6d2c2 1px solid; padding-right: 10px; border-top: #faf9f4 1px solid; border-left: #faf9f4 1px solid; border-bottom: #d6d2c2 1px solid; background-color: #ebeadb; text-align: right; color: black;" />
<CellStyle CssText="padding-left:8px;padding-top:2px;white-space:nowrap;" />
</eo:GridItemStyleSet>
</ItemStyles>
<Columns>
<eo:RowNumberColumn Name="col_Row" Width="25" HeaderText="#">
<CellStyle CssText="text-align: center" />
</eo:RowNumberColumn>
<eo:CustomColumn HeaderText="Requirements" ClientSideBeginEdit="on_begin_edit1"
ClientSideEndEdit="on_end_edit1" Name="col_RequestDetail" Width="500"
DataType="String" DataField="RequestDetail" >
<EditorTemplate>

<table border="0" cellpadding ="0" cellspacing ="0" >
<tr>
<td>
<textarea id="txt_RequestDetail" cols="50" rows="3" ></textarea>
<eo:SpellChecker id="SplChkr1" runat="server" DialogID="SplchkDlg1" ControlToCheck="txt_RequestDetail"
StartButton="BtnSplchk"></eo:SpellChecker>
</td>
<td valign ="bottom" >
<asp:ImageButton runat ="server" ID="BtnSplchk" ImageUrl="~/Images/SpellCheck.gif" />
</td>
</tr>
</table>


</EditorTemplate>
</eo:CustomColumn>
<eo:EditCommandColumn Name="col_Edit">
</eo:EditCommandColumn>
<eo:DeleteCommandColumn Name="col_Delete" Width="50">
</eo:DeleteCommandColumn>
<eo:StaticColumn DataField="UserRequestDetailID" Name="col_UserRequestDetailID"
Visible="False" Width="0">
</eo:StaticColumn>
</Columns>
</eo:Grid>

</div>


<eo:SpellCheckerDialog id="SplchkDlg1" Width="320px" Height="216px" runat="server" ControlSkinID="None"
CloseButtonUrl="00020440" HeaderHtml="Dialog Title" MinHeight="100" MinWidth="150" HeaderImageHeight="27"
HeaderImageUrl="00020441" HeaderHtmlFormat='<div style="padding-top:4px">{0}</div>' AllowResize="True">
<FooterStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; font-family: tahoma"></FooterStyleActive>
<HeaderStyleActive CssText="background-image:url(00020442);color:#444444;font-family:'trebuchet ms';font-size:10pt;font-weight:bold;padding-bottom:7px;padding-left:8px;padding-right:0px;padding-top:0px;"></HeaderStyleActive>
<ContentStyleActive CssText="background-color:#f0f0f0;font-family:tahoma;font-size:8pt;padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px"></ContentStyleActive>
<BorderImages BottomBorder="00020409,00020429" RightBorder="00020407,00020427" TopRightCornerBottom="00020405,00020425"
TopRightCorner="00020403,00020423" LeftBorder="00020406,00020426" TopLeftCorner="00020401,00020421"
BottomRightCorner="00020410,00020430" TopLeftCornerBottom="00020404,00020424" BottomLeftCorner="00020408,00020428"
TopBorder="00020402,00020422"></BorderImages>
</eo:SpellCheckerDialog>
</form>
</body>
</html>
eo_support
Posted: Friday, October 21, 2011 1:27:32 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

It doesn't appear that you can do that. The Grid will exit edit mode when it loses focus --- which is triggered when you click the SpellCheck button. So as soon as you click the SpellCheck button, ClientSideEndEdit will be triggered and the textbox will be gone. What you can do is:

1. Place an additional TextBox control in your page and set its display to "none" initially;

2. Inside your ClientSideEndEdit, move that TextBox to the same location of the Grid cell, you would need to call this function to get the DOM element of the cell and then calculate the DOM element's location:

http://doc.essentialobjects.com/library/1/jsdoc.public.gridcell.getdomelement.aspx

3. Set the textbox's value to the value of your Grid cell;

4. Handle your spell check button's onclick on the client side with JavaScript, inside the handler call SpellChecker.check with the TextBox's DOM element to start spellcheck on your textbox control. Note this has nothing to do with the Grid. The code would be something like this:

Code: JavaScript
var spellChecker = eo_GetObject("SpellChecker1");
var textbox = document.getElementById("&lt;%=TextBox1.ClientID%&gt;");
spellChecker.check(textBox);


5. Handle your SpellCheckerDiaog's ClientSideOnEnd event. Inside that event use JavaScript to get the new content in your textbox, and then call this method to pass the new value to the Grid cell:

http://doc.essentialobjects.com/library/1/jsdoc.public.gridcell.setvalue.aspx

Hope this helps.

Thanks!
abzil
Posted: Wednesday, November 2, 2011 1:08:58 PM
Rank: Newbie
Groups: Member

Joined: 1/16/2011
Posts: 5
This works with previous EO.Web.dll

When I switch back it is working fine. Can you please check with old EO.Web.dll
eo_support
Posted: Wednesday, November 2, 2011 1:22:49 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Our previous reply described how it should work. The previous version might have worked for you but if it behaviors differently than how it supposes to work, then that would be considered a bug, even though it happens to work for you. We cannot change the current version just because it does not work for your scenario as there are other people who reply on the product working the way it currently works. If we change it, then they will want us to change it back.

Thanks!
abzil
Posted: Friday, November 4, 2011 2:18:23 AM
Rank: Newbie
Groups: Member

Joined: 1/16/2011
Posts: 5
The previous version works (Not might have worked) and the new version does not work. Is this considered a bug?
If yes it does not matter only I used this event, should it not be fixed to work with the previous version.
eo_support
Posted: Friday, November 4, 2011 7:45:36 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
I believe our previous reply has already clearly explained our position. This issue is now closed.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.