Chrome, Firefox - Double clicking on the checkbox can't triggle the event OnCellDblClick when the

4 replies. Last post: November 11, 2016 6:55 PM by mang lu
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
mang luMember

Hello,

I found a problem that in Chrome or Firefox, if the checkbox cells are set to no editable by using

javascript function "SetForceNoEdit(true)", then double click into the checkbox itsself doesn't trigger

the eventer handler "OnCellDblClick", but if click on the cell where around the checkbox will trigger

the event. My javascript code and the setting of grid is as below.

Could you please give me an idea how to fix this issue.

Thanks,

Mang


<script type="text/javascript">

$(document).ready(function () {

var grid = ISGetObject("OwGrid1");

if(grid)




DisableAllCheckboxCells(grid);


});



function DisableAllCheckboxCells(grid) {

for (var i = 0; i < grid.RootTable.GetRowsCount() ; i++) {

var row = grid.RootTable.GetRow(i);

var cells = row.GetCells();

for (var k = 0; k < cells.length; k++) {

if (cells[k] != null && !cells[k].Column.IsRowChecker && cells[k].Column.ColumnType ==="CheckBox")

cells[k].SetForceNoEdit(true);




}


}


}



function dblClick() { alert("double click!"); }

</script>



<IsNet:WebGrid ID="OwGrid1" runat="server" UseDefaultStyle="True" DefaultStyleMode="Elegant" OnInitializeDataSource="OwGrid1_InitializeDataSource">

<RootTable DataKeyField="FIPS" RowHeaders="Yes" RowHeightDefault="20px" Caption="Another Grid" TableHeaderVisible="true" AllowSorting="Yes" AllowEdit="Yes">

<Columns>

<ISNet:WebGridColumn Name="FIPS" DataMember="FIPS"/>

<ISNet:WebGridColumn Name="LastModified" DataMember="LastModified" EditType="CalendarCombo" DataType="System.DateTime" HiddenDataMember="RandomDateTime"/>

<ISNet:WebGridColumn Name="RandomDateTime" DataMember="RandomDateTime" EditType="TextBox" DataType="System.DateTime" Width="-1px"/>

<ISNet:WebGridColumn Name="Post2K" DataMember="Post2K" Width="50px" EditType="Checkbox" ColumnType="CheckBox" Caption="Post 2k"/>

</Columns>

</RootTable>

<LayoutSettings AllowSelectColumns="Yes" AllowFilter="Yes" AllowGrouping="Yes" AllowEdit="Yes" AllowSorting="Yes" AllowColumnSizing="Yes" PagingMode="ClassicPaging" RestoreRowSelection="All" HeaderWrapDefault="True" >

<ClientSideEvents OnCellDblClick="dblClick"></ClientSideEvents>

</LayoutSettings>

</IsNet:WebGrid>


All times are GMT -5. The time now is 1:16 AM.
Previous Next