Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
590
Jquery doesn't work after wdg does a partial postback
posted

I added a link button in a templateField into my wdg with a cssClass 'delete'. 

I capture the click event of those linkbuttons in jqurey like so:

$('.delete').click(function () {

} );

in that function I ask the user to confirm the delete. 

This works fine, except when anything is done to the webdatagrid that causes a partial postback. Like filtering, changing page, sorting ...

In general when using update panels I wrap my jQuery code in pageLoad function and that seems to rebind the jquery events. But it does NOT help for webdatagrid.

What can I do to make sure that jquery works throughout wdg partial postbacks?

Thanks in advance

Parents
No Data
Reply
  • 29417
    Verified Answer
    Offline posted

    Hello boruchsiper,

     

    Thank you for posting on our forum.

     

    Set the binding of the event in the grid’s client side Initialize event. In that way since this event will fire after every partial postback that the grid does the event will get re-binded.

    For example:

     

    function WebDataGrid1_Grid_Initialize(sender, eventArgs)

    {

           ///<param name="sender" type="Infragistics.Web.UI.ControlMain"></param>

           ///<param name="eventArgs" type="Infragistics.Web.UI.EventArgs"></param>

     

        $('.delete').click(function () {

           ...

        });

    }

     

    Let me know if you have any further questions or concerns.

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer

    Infragistics, Inc.

    http://es.infragistics.com/support

     

Children
No Data