House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Detecting Dirty Data inside a cflayout (aka Ext TabPanel)

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Mark Pitts
12/01/2008 05:08 AM

The problem I was trying to solve was to be able to prompt the user before changing tabs whenever there is dirty data on the current tab. My first approach was to use the Ext.TabPanel's beforetabchange event. This strategy works if I did not implement any sort of prompting. As soon as I implement a prompt it appears that the process does not wait. With that said, I found that a better strategy would be to capture the click event on the tabPanelItem. One more hurdle to overcome, though. I discovered this thread (http://extjs.com/forum/showthread.php?p=35981) about 2 events being fired (onTabMouseDown and onTabClick) when clicking the tab. var bDirty = false; /* Tab panel hack as part of dirty data support */ Ext.override(Ext.TabPanelItem, { onTabMouseDown : function(e){     e.preventDefault();     //this.tabPanel.activate(this.id); }, onTabClick : function(e){     e.preventDefault();     /* dirty data check - start */     currentPanel = this.tabPanel;         if (isDataDirty())         {             confirmAction('You have modified data. Do you wish to continue?',             function()  {                 // reset flag                 bDirty = false;                 currentPanel.activate(this.id);             });         } else {             this.tabPanel.activate(this.id);         }     /* dirty data check - end */ } });    var DirtyData = function() {bDirty = true;} // end DirtyData var isDataDirty = function() {return bDirty;} // end isDataDirty Cheers! Mark (http://www.edgewater.com)

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Michael Hanson
09/23/2011 03:39 PM

Can you give a top down example of how to do this via javascript in a coldfusion application.     This is what I am familiar with doing:     var mytabs = ColdFusion.Layout.getTabLayout('theTab');     mytabs.on('tabchange', function (tabpanel, activetab) {         getTab(activetab.getText());     });

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Michael Hanson
09/23/2011 03:40 PM

Can you give a top down example of how to do this via javascript in a coldfusion application.     This is what I am familiar with doing:     var mytabs = ColdFusion.Layout.getTabLayout('theTab');     mytabs.on('tabchange', function (tabpanel, activetab) {         getTab(activetab.getText());     });


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference