iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
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.
Hi Mark,
Maybe this problem happen because when WebGrid do sorting it will render its row again so your javascript won't attach to each checkbox. However, you still can achieve this scenario by using OnCheckBoxClick client side events.
Here's the snippet:
function OnCheckBoxClick(controlId, a, b, c, d) { var WebGrid1 = ISGetObject(controlId); alert("select"); return true; }
Hope this helps.
Regards,Bernard
Hi Bernard,
Thanks for your reply. This event works. But does it fire for all Check Box type in the Grid? What if I have some boolean type column using Check box to display value? Will it also fire this event?
Why OnRowSelectorClick is not fired when I click on the check box?
When you used OnCheckBoxClick event, it will trigger if you click any checkbox on WebGrid. However you still can validate the position of the checkbox in client side events. Actually OnRowSelector trigger if the row selector in WebGrid is clicked. Please look at my screenshot to see where the row selector is. Hope this helps.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname