EasyUI Forum
May 02, 2024, 02:43:14 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Prompt message if some value change in a form in different tab  (Read 8942 times)
acreonte82
Jr. Member
**
Posts: 85



View Profile
« on: March 27, 2014, 09:21:38 AM »

Hello to all,
I've a multi -tab and, for each tab, a form with some value loaded from the server (attached the image).

My intention is: if some user changes some data in a form and then change tab without saving, the system notify that some value change and the system propose the possible actions before to contine

How can I implement it ?

Thanks
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 28, 2014, 01:30:08 AM »

When leaving a tab panel, the 'onUnselect' event fires. You can use this event to do your detecting login. If you don't allow the user to switch to other tab panels, call 'select' method again on the current tab panel. Please try the code below:
Code:
$('#tt').tabs({
    onUnselect:function(title,index){
        var p = $(this).tabs('getTab', index);
        var f = p.find('form');
        if (f.length){
            if (!f.form('validate')){
                $(this).tabs('select', index);
            }
        }
    }
})
Logged
acreonte82
Jr. Member
**
Posts: 85



View Profile
« Reply #2 on: March 28, 2014, 03:08:30 AM »

I explain my intention:
in the attached image you see a value at "Picogreen" field.
If I change in a new value (ex: 30) , i want that the system notify me that value is changed if I switch in other tab without saving.

That's all
Logged
acreonte82
Jr. Member
**
Posts: 85



View Profile
« Reply #3 on: April 01, 2014, 03:13:10 AM »

I've to work with the cache?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!