[ 2 posts ]

Khoa Bui

  • Username: khoaminhbui
  • Joined: Tue Aug 09, 2011 6:11 am
  • Posts: 127
  • Location: Vietnam
  • Twitter: khoaminhbui
  • IRC: k_bui
  • Offline
  • Profile

TabView: conditionally prevent tab change.

Post Posted: Sat Sep 15, 2012 9:52 am
+0-
The scenario is that:

- The tabview has 2 tabs, every tab has a form for user to input and save information. User input some data on tab 1 but do not save, then he click tab 2. The code listen to 'selectionChange' on the tabview, and detect that there is an incomplete action on tab 1, then display a popup to inform user about incomplete operation, user can choose to ignore or come back to tab 1 to finish.

- If user choose continue working on tab 1, how can I ignore tab 2 peacefully and stay on tab 1?

John Lindal

YUI Contributor

  • Username: jafl
  • Joined: Mon Nov 02, 2009 2:33 pm
  • Posts: 352
  • Location: Los Angeles, CA
  • Twitter: jafl5272
  • GitHub: jafl
  • Gists: jafl
  • Offline
  • Profile

Re: TabView: conditionally prevent tab change.

Post Posted: Mon Sep 17, 2012 8:17 am
+0-
If you listen for beforeSelectionChange, then you can use e.halt() in your event handler.
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum