Question: I am writing some code to write out an email to a file, let you edit it in your own editor, and when you're done you can tell my code to carry on. I'd like to have it catch the common error where you still have the file open, and therefore might not have saved it. 

My first attempt was to try to obtain an exclusive lock on the file (using [File.flock](http://www.ruby-doc.org/core/classes/File.html#M000032)) but that never caught it. A bit more googling suggests that [this is a hard problem](http://www.ruby-forum.com/topic/205774).

The best suggestion appears to be to look for common lock files, eg `vi foo` will make `.foo.swp` while `joe foo` will make `.#foo`.

So the question is, is there a better way to tell if a file is being edited? And if not, is there a list of all common lock file naming conventions?

Answer: 
After some Firebug stepping, I found this works quite well.

```
var store = this.getStore();
store.remoteFilter = false;
store.clearFilter();
store.remoteFilter = true;
store.filter(...);

```

`remoteFilter` does not seem to be a documented property, but it will suspend xhr calls while it's set to `false`.

When you set `remoteFilter` to false, when `clearFilter()` is called, the `load()` function is stepped over.
The clearFilters() method available with GridFilter class should be able to clear the filters. Did you give it a try? Also, when does the grid#2 get loaded? according to your first para, when the user select a manager the employees are listed. But in the second para where you stated your requirement, you said the grid#2 is loaded through another function!.. no clear with that though.