Click here to Skip to main content
15,885,953 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I've pagination that is using jquery code and ajax calls. When I'm clicking on page 2 on pagination then some ajax call hit but my CSS and jquery popups not working. Please share your view bout this.

Thanks
Posted
Comments
Zafar Sultan 21-Oct-13 6:08am    
Post your code. My guess is that you have written jQuery function on document's ready event and after postback that is not working. This is the default behaviour of JQuery with partial postbacks. Post your code. It will make things a lot clear.
Ravi K.Singh 21-Oct-13 7:12am    
yes, your guess is correct, here is my code. Please refine the if you have some time. Thanks

$( document ).ready(function() {
popup.showStyle();
indicator.tooltipMessage();

$(".btn_approve").click(function (e) {
e.preventDefault();
var $el = $(this);
$el.parents("tr").remove();
});
});

// Indicator tooltips
var indicator = {
messages : {
valid : "It is a Valid Change",
invalid : "It is an Invalid Change",
invalidEmpty : "You can not have an empty Name"
},
tooltipMessage : function(){
var self = this;

$('table td').on('mouseover',function(e) {
e.preventDefault();
var div = $(this).find(".valid_message_box");
if(div){
if($(this).hasClass("is_valid ")){
$(div).html(self.messages.valid).show();
return;
}
else if($(this).hasClass("is_invalid")){
var dataCell = $(this).text();
dataCell == "" ? $(div).html(self.messages.invalidEmpty).show() : $(div).html(self.messages.invalid).show();
return;
}
}
//$(".valid_message_box").css('top', $(this).position().top - 30).css('left', $(this).position().left + $(this).width());
});
$('table td').on('mouseout',function(e) {
$(this).find(".valid_message_box").hide();
});
}
}
Ravi K.Singh 21-Oct-13 7:58am    
Hi
I've tried that code on window load but still not working.

Thanks

Instead of using document.ready() use:
JavaScript
<script type="text/javascript">
$(window).load(function () {    
    popup.showStyle(); 
    indicator.tooltipMessage(); 
    $(".btn_approve").click(function (e) {
        e.preventDefault(); 
        var $el = $(this); 
        $el.parents("tr").remove(); 
    });
});
</script>
 
Share this answer
 
I'm not sure weather is my code is a optimize solution or not but working exactly that i needed

C#
$(document).ready(function () {
    // Table data Tooltip messgae box
    $('body').on('mouseover','table td',function(e) {
        indicator.tooltipMessage();
    })
});

// Indicator tooltips
var indicator = {
    messages : {
        valid : "It is a Valid Change",
        invalid : "It is an Invalid Change",
        invalidEmpty : "You can not have an empty Name"
    },
    tooltipMessage : function(){
        var self = this;

        $('table td').on('mouseover',function(e) {
            e.preventDefault();
            var div = $(this).find(".valid_message_box"),
                msgbox = $(".valid_message_box span.msgbox"),
                arrowTop = $(".valid_message_box span.arrow_top");

            if(div){
                if($(this).hasClass("is_valid ")){
                    div.show();
                    arrowTop.show();
                    $(msgbox).html(self.messages.valid).show();
                    return;
                }
                else if($(this).hasClass("is_invalid")){
                    var dataCell = $(this).text();
                    div.show();
                    arrowTop.show();
                    dataCell == "" ? $(msgbox).html(self.messages.invalidEmpty).show() : $(msgbox).html(self.messages.invalid).show();
                    return;
                }
            }
        });
        $('table td').on('mouseout',function(e) {
            $(this).find(".valid_message_box").hide();
        });
    }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900