2

I want to use tab widget of jQueryUI in dotnetnuke 5.6.3 I registered jQueryUI in my module and it works fine but when I use partial Rendering in my page it fails to load.

Here is my code:

$(document).ready(function () {
    rastaAdmin();
});
function rastaAdmin() {
var tabdiv = $('#tabul');
var tabvar = tabdiv.tabs();
}

this site have a method to solve my problem but it doesn't work in my script.

After reading the above site I changed my code to:

$(document).ready(function () {
    rastaAdmin();
});
function pageLoad(sender, args) {
    rastaAdmin();
}
function rastaAdmin() {
var tabdiv = $('#tabul');
var tabvar = tabdiv.tabs();
}

This Doesn't work for me.

What Can I do?

Thank You

William Niu
  • 15,798
  • 7
  • 53
  • 93
Mosijava
  • 3,941
  • 3
  • 27
  • 39

2 Answers2

6

I've had issues using the pageLoad function as well (though I don't remember now where it ended up breaking down). However, something like the other method should work fine (see the new jQuery UI setup in the core modules in DNN 6):

$(document).ready(function () {
    setupDnnSiteSettings();
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
        setupDnnSiteSettings();
    });
});

The one caveat here is that this registers the setup code to happen after returning from any UpdatePanel-initiated request, not just your specific UpdatePanel. Calling tabs again on the same element shouldn't cause any issue, but you'll want to figure out a way to differentiate if you're doing something that should only be called once.

bdukes
  • 152,002
  • 23
  • 148
  • 175
2

Thank you bdukes
After your help, I changed my code to:

$(document).ready(function () {
Sys.Application.add_load(function (s, e) { rastaAdmin(); });
rastaAdmin();
});
function rastaAdmin() {
var tabdiv = $('#tabul');
var tabvar = tabdiv.tabs();
}

And It Works Like a charm for me! Thank You mate.

Mosijava
  • 3,941
  • 3
  • 27
  • 39