Rank: Member Groups: Member
Joined: 11/1/2010 Posts: 18
|
Hi
update functionality of edit command column of grid is not working when I use Javascript for ClientSideEndEdit in ASCX page. this functionality working fine for my ASPX page. Please guide me
ASCX Code: <Columns> <eo:EditCommandColumn Name="edit" Width="40"> </eo:EditCommandColumn> <eo:CustomColumn HeaderText="Dimension Member" ClientSideBeginEdit="on_begin_edit2" ClientSideEndEdit="on_end_edit2" Width="120"> <EditorTemplate> <asp:DropDownList ID="SelectMember2" runat="server" Width="120px"> </asp:DropDownList> </EditorTemplate> </eo:CustomColumn> </Columns>
JavaScript:
<script type="text/javascript">
var id2 = '<%=((EO.Web.CustomColumn)EntryGrid2.Columns[2]).EditorInstance.FindControl("SelectMember2").ClientID%>';
function on_begin_edit2(cell) { //Get the current cell value var v2 = cell.getValue();
//Use index 0 if there is no value if (v2 == null) v2 = 0;
//Load the value into our drop down box var dropDownBox2 = document.getElementById(id2); dropDownBox2.value = v2; } function on_end_edit2() { //Get the new value from the drop down box var dropDownBox2 = document.getElementById(id2); var v2 = dropDownBox2.value;
//Return the new value to the grid return v2; }
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
This usually has to do with you having multiple instance of your user control in the same page. When that is the case, you will actually have multiple "on_begin_edit2" and "on_end_edit2" functions in your page with different contents, with the last one overwriting all previous ones. To avoid the problem, you will have to devise a plan to have different function names for different instance of your user control.
Thanks
|