PDA

View Full Version : Synchronous Execution



rakesh.mmp
22 Apr 2015, 11:56 PM
Hi,

How can synchronous execution of statements be achieved in ext-js.
Please suggest some solution regarding this.

Thanks & Regards
Rakesh

tristan.lee
23 Apr 2015, 8:10 AM
Hi,

Can you give an example of what you are trying to accomplish?

Thanks,
Tristan

rakesh.mmp
29 Apr 2015, 10:22 PM
Hi tristan.lee,

In my application there is a grid which display's list of records.When a record is selected in the grid that particular record's details are shown in a form.

Consider this scenario suppose a user type's some data in the form's fields or changes the form data and then select's a different record without saving changes to the currently selected record then a message will be show [Alert message] whether to save or cancel.

Here i want to stop the selection of that new record till the user click's save or cancel.
Is there a way to stop the selectionchange event till the user selects option in alert box.
Please suggest some solution for this.

Thanks & Regards
Rakesh

tristan.lee
30 Apr 2015, 7:50 AM
You're not going to be able to prevent the selection of a different row if the grid is active. One suggestion I have is whenever the user is editing in the form, if the record becomes dirty (eg: they change a value), disable the grid (setDisabled(true)) until the form is either cancelled/saved, at which point you can re-enable the grid so they can select another row.

skirtle
1 May 2015, 8:12 AM
You can prevent the selection using the beforeselect event, though it'll get a bit fiddly.

tristan.lee
1 May 2015, 1:14 PM
You're correct about beforeselect. It will prevent the row from being added to the selection model. Unless you mess with overCls, it will still appear the row is selected since it will be highlighted.