Where should i use method before load Jqgrid and after load grid to block screen?
<p>I have written a functionality in java-script that blocks the screen and unblock the screen. Block screen means, it blocks the screen so user can not click anything(a loader icon comes on the screen). </p>

<p>There are two methods of UIBlocker.</p>

<pre><code>1. UIBlocker.blockScreen()   // It blocks the screen.
2. UIBlocker.unblockScreen()  // It unblocks the screen.
</code></pre>

<p>Now, i need to block the screen when JQGrid is being loaded. I want to ask where should i use <strong>UIBlocker.blockScreen()</strong> and <strong>UIBlocker.unblockScreen()</strong>.?</p>

<p>According to my findings, <strong>UIBlocker.blockScreen</strong> should be used in <strong><em>beforeRequest</em></strong> event because it fires before requesting data. But there also some other events that fire before load like <strong>beforeProcessing,loadBeforeSend</strong>. So i am still confuse about it.</p>

<p>The second thing is where should i use <strong>unblockScreen</strong>. In <strong>loadComplete</strong> or in <strong>gridComplete</strong>?</p>

<p>Here, i found the order of execution of jqgrid,</p>

<pre><code>beforeRequest
loadBeforeSend
serializeGridData
loadError (if a error from the request occur - the event from steps 5 till 7 do not execute. If there is no error the event 4. does not execute and we continue to with the step 5.)
beforeProcessing
gridComplete
loadComplete
</code></pre>

<p>Now suggest me, where should i use <strong>BlockScreen</strong> and <strong>unblockScreen</strong>?</p>