RowChecker related problem

3 replies. Last post: August 26, 2013 9:20 PM by Bernard Xiang
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Mark OMember

Hello, 

We are using WebGrid 8 and have problems to add custom client side event handler on the RowChecker column. 

Initially, I used Jquery to attach on change(or click) event handler to input field of Rowchecker column. It works fine when normal scenario. But if users click on column to sort or navigate between pages(basically an asynchronous post back), the Jquery event handler will never be triggered.

Then I tried to use WebGrid client event OnRowSelectorClick to add my function. It also never worked. It was not even fired in normal scenario.

Here is my code snippet:

<script type="text/javascript">

    $(document).ready(function () {

        GridBatchDeleteSetup();

    });

    function GridBatchDeleteSetup() {

        $("input.DefChkBox")

        .on('change', BatchDeleteButtonEnableDisable);

    }

    function BatchDeleteButtonEnableDisable() {

        alert("123");

    }

    function OnRowSelectorClickTest(gridId, tblName, rowIndex, rowEl) {

        alert("test");

        return true;

    }

</script>

 

<IsNet:WebGrid ID="Gri1" runat="server"Width="100%"DataSourceID="dsCountries"UseDefaultStyle="True"DefaultStyleMode="Elegant">

    <RootTable RowHeaders="Yes" RowHeightDefault="20px" Caption="New Title" TableHeaderVisible="true">

        <Columns>

            <IsNet:WebGridColumn Name="Id" DataMember="CountryId" Caption="CustomerID"  />

            <IsNet:WebGridColumn Name="CountryN" DataMember="CountryName" DataType="System.String" Caption="Name"  />

            <IsNet:WebGridColumn Name="Vessel" DataMember="Vessels" DataType="System.String" Caption="Vess"  />

             <IsNet:WebGridColumn Name="checker" IsRowChecker="true" />

        </Columns>

    </RootTable>

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

    <ClientSideEvents  OnRowSelectorClick = "OnRowSelectorClickTest"/>

    </LayoutSettings>

</IsNet:WebGrid>

 

Please advise how to solve this problem. Thanks.

All times are GMT -5. The time now is 2:09 AM.
Previous Next