Problem with jquery #find on partial postback

Posted by anonymous on Stack Overflow See other posts from Stack Overflow or by anonymous
Published on 2010-06-11T05:11:18Z Indexed on 2010/06/11 5:23 UTC
Read the original article Hit count: 257

Filed under:
|
|
|

I have a third party component. It is a calendar control. I have a clientside event on it which fires javascript to show a popup menu. I do everything client side so I can use MVC.

dd

   function MouseDown(oDayView, oEvent, element) {

    try {

        e = oEvent.event;

        var rightClick = (e.button == 2);
        if (rightClick) 
        {
            var menu = $find("2_menuSharedCalPopUp");
            menu.showAt(200, 200, e);
        }


    }
    catch (err) {
        alert("MouseDown() err: " + err.description);
    }


}

The javascript fires perfectly withe $find intially.

I have another clientside method which updates the calendar via a partial postback. Once I have done this all subsequent MouseDowns( rightclicks) which use the $find statment error with 'null'.

All similar problems people have out there seem to be around calling javascript after a postback - with solutions being re-registering an event using PageRequestManager or registering a clientside function on the server - et cetera.

However, the event is firing, and the javascript working - it's the reference in the DOM that seems an issue.

Any ideas?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about mvc