Welcome Guest Search | Active Topics | Sign In | Register

Grid ClientSideEndEdit & ClientSideBeginEdit Javascript not firing in UpdatePanel Options
sgosselin
Posted: Monday, August 4, 2008 8:57:53 AM
Rank: Member
Groups: Member

Joined: 6/13/2008
Posts: 11
Hi! I have a page with an update panel. I'm not using your callback panel because I also have a custom control that doesn't work inside your panel.

My problem is that my Grid using a CustomColumn with a select box, doesn't fire the
ClientSideEndEdit & ClientSideBeginEdit javascript event when I edit my cell. If I remove the update panel of the page, it's working. Do you know why it can't fired Javascript event?

This part of the code is in a CustomServerControl inserted in an aspx page. The update panel is in the aspx page for the whole application.

Code: HTML/ASPX
<script type="text/javascript">

    var g_curItemIndex = -1;

    function beginEdit(cell) {

        g_curItemIndex = cell.getItemIndex();

        var v = cell.getValue();

        var dropDownBox = document.getElementById("seanceTypeList");

        for (var i = 0; i < dropDownBox.options.length; i++) {

            if (dropDownBox.options[i].value == v) {

                dropDownBox.selectedIndex = i;
                return;
            }
        }

        dropDownBox.selectedIndex = 0;
    }

    function endEdit(cell) {

        var dropDownBox = document.getElementById("seanceTypeList");
        var selectedIndex = dropDownBox.selectedIndex;

        if (selectedIndex > 0) {

            return dropDownBox.options[selectedIndex].value;
        }

        return null;
    }
    
</script>

<eo:Grid ID="seanceGrid" KeyField="SeanceID" runat="server" GridLines="Both" GridLineColor="0, 51, 0"
                    ForeColor="#003300" Font-Names="Verdana" BorderStyle="Solid" BorderWidth="1px"
                    Font-Size="8.75pt" FullRowMode="False" Font-Bold="False" Font-Italic="False"
                    Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Height="500px"
                    ItemHeight="50" Width="680px" AllowNewItem="True" AllowPaging="True">
                    <ColumnHeaderStyle CssText="text-align: left; padding-top: 3px; color: #003300; font-weight: bold; background: #ffffff url('./Images/GridHeader-Bg.png') repeat-x;">
                    </ColumnHeaderStyle>
                    <Columns>
                        <eo:CustomColumn HeaderText="Type" Width="100" DataField="Description" ClientSideEndEdit="endEdit"
                            ClientSideBeginEdit="beginEdit">
                            <CellStyle CssText="text-align: left; padding-top: 2px; padding-right: 2px;" />
                            <EditorTemplate>
                                <select id="seanceTypeList" style="width: 100px">
                                    <option>Choisir</option>
                                    <asp:Repeater runat="server" ID="seanceTypeRepeater">
                                        <ItemTemplate>
                                            <option value='<%#DataBinder.Eval(Container.DataItem, "Description")%>'>
                                                <%#DataBinder.Eval(Container.DataItem, "Description")%>
                                            </option>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </select>
                            </EditorTemplate>
                        </eo:CustomColumn>
                    </Columns>
                </eo:Grid>
Code: JavaScript
Code: JavaScript
sgosselin
Posted: Monday, August 4, 2008 10:02:41 AM
Rank: Member
Groups: Member

Joined: 6/13/2008
Posts: 11
Finaly, I resolve this issue by moving the Javascript from the CustomServerControl to the main page header.
thanks
eo_support
Posted: Monday, August 4, 2008 10:52:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,193
Thanks for the update. That makes perfect sense. Unlike our CallbackPanel, UpdatePanel does not "expose" JavaScript functions defined inside it.


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.