English 中文(简体)
JQuery Simplemodal and Tabs Help Needed
原标题:

I ve got an asp.net page containing a Textbox with an Autocomplete extender on it. It s setup so the user can type a short reference code into the textbox and then choose from the list of matching codes returned by the autocomplete.

On the "select", I then call the server using JQuery. I m currently using $.get here.... The callback function from $.get checks for "success" and then displays a simple-modal dialog containing info about the item they ve just selected.

if (sStatus == "success") {
        $.modal(sText, {
        overlayClose: true,
            appendTo: form ,
            onShow: function(dialog) {
                $("#ccTargets_tabContainer").tabs();
            },
            onClose: function(dialog) {
                $("#<%=TextBox1.ClientID%>").val("");
                $.modal.close();
            }
        });
        $.ready();
    }

One of the bits of info being loaded here is a JQuery TABS setup, so the onShow function of the simplemodal is used to initiate the tabs which are within the simplemodal.

Now to the crux of my problem. If I do multiple consecutive "autocompletes" on the same page it all works fine Unless I have selected a different tab on the tabs in the simplemodal ....If I select a different tab, close the simplemodal and then do another autocomplete I get a JQuery error which seems to relate to a selector doing something with the "old" selected tab that was on the "closed" modal.

I m clearly missing some sort of cleardown / initialisation somewhere, but can t find what it is. Help?

I ve tried "tabs.destroy" before the modal call in the code above and I ve tried a $.ready() call as indicated too....

UPDATE: Is it something to do with JQuery Tabs appending my addressbar URL with the selected tab s ID?

最佳回答

I ve found the problem. It s with the "history" script that the tabs plugin normally uses. Obviously as I am continually creating and destroying popups there is no history to speak of - it s all done outside of the normal app navigation.

I ve removed the jquery.history_remote script and now it works just great!

Dave

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签