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
1145
jquery .bind not working with events???
posted

I have a grid and I wanted to use .bind and .unbind to handle events, but I can't seem to get bind to work.

If I do:

        grid.igGrid({
            dataRendered: function () {
                handleRendered();
            }
        });

handleRendered will get called.

If I do:

        grid.bind("dataRendered", function () {
                handleRendered();
            }
        });


handleRendered will not be called.

Now, obviously I want to bind and unbind the same function, but I did this to demonstrate the failure. Am I doing something wrong? In both cases, grid is the same $(selector)...

Am I missing something?

Parents
No Data
Reply
  • 4315
    Verified Answer
    Offline posted

    Hi, Pete.

    Please follow this link to the igGrid API documentation, to see how to attach to grid events using "bind" ("delegate" or "on").

    What you need to do is to use the full path of the event, following the jQuery UI convention - name of the control + name of the event:

    grid.bind("iggriddatarendered", function () {
                    handleRendered();
                }
            });
    
    

    Best regards,
    Nikolay Alipiev

Children