PDA

View Full Version : synchronous messagebox



littlegg
21 Jun 2007, 5:34 PM
can messagebox work in synchronous mode?

I am using a PageToolbar for EditorGrid. some users edited the cells and press next page button, their modification will be lost. so i add a Ext.MessageBox.show function to Data.Store's beforeLoad event, user can choose to save changes or not , or cancel action. but i think the messagebox is working in asynchronous mode, before user click any button, the grid has changed to next page. if i use window.confirm function, grid will hang waiting for user choice. but i need Yes, no ,cancel buttons, window.confirm only have yes and cancel buttons. how should i do?

tryanDLS
21 Jun 2007, 5:39 PM
Look at the messagebox example - you have to provide a callback. It doesn't work like alert/confirm where it waits and returns a value.

littlegg
21 Jun 2007, 6:21 PM
Look at the messagebox example - you have to provide a callback. It doesn't work like alert/confirm where it waits and returns a value.


yes, i provide a callback function. but can what is running background hang up before i click any button?

liggett78
22 Jun 2007, 1:45 AM
There is no way to "pause" execution like native confirm or alert do. You should setup a callback and do this "go-forward in the grid"-thing from inside this callback.