I don´t know if is crearly enough:
On the select propertie of the tab I call a function. This works great
with validation plugin, due to it returns true or false without user
action. the problem is when I present a dialog to the user in order to
determine weather to return true or false. when I launch the dialog,
it returns true to the select tab event, so despite the dialog launchs
and wait for user choice, the tab has already changed.
thanks
On 14 sep, 11:51, oscarml <osca...@gmail.com> wrote:
> Hi klaus,
>
> I had already read the FAQ, and as you can see in my code I'm using
> the select property. This works fine for example if you run a function
> that returns true or false without asking user anything, but in my
> case I need the user to choose one option. Then, when I offer the
> dialog box, the code inside the 'select' property is returning true,
> before the user press a button.
>
> Any idea?
>
> On 1 sep, 06:18, Klaus Hartl <klaus.ha...@googlemail.com> wrote:
>
> > See FAQ:http://docs.jquery.com/UI/Tabs#...prevent_switching_to_the_tab_on_cli...
>
> > --Klaus
>
> > On Aug 31, 5:23 pm,oscarml<osca...@gmail.com> wrote:
>
> > > Hi to everybody,
>
> > > I'm trying to control tab switching depending on user answer to a
> > > dialog. Here is my code;
>
> > > var TabSolicitud = $('#SolicitudAguaTabContainer > ul').tabs({
> > > select: function(e, ui){
> > > $("#InfoDialog").html("Do you want to save changes?");
> > > $("#InfoDialog").dialog({
> > > modal: true,
> > > addClass: 'ModalInfo',
> > > resizable: false,
> > > title: "<img src='imagenes/messagebox_info.png' class='img_title' /> ",
>
> > > overlay: {
> > > opacity: 0.5,
> > > background: "black"
> > > },
> > > buttons: {
> > > "Yes": function() {
> > > $(this).dialog("close");
> > > SaveChanges();
> > > },
> > > "NO": function() {
> > > $(this).dialog("close");
> > > return false;
> > > }
>
> > > });
>
> > > The problem is that when I show the dialog, the tab switched to the
> > > selected one. It doesn´t wait until it knows the answer of the user.
>
> > > What could I do?
No comments:
Post a Comment