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).
There are two methods of UIBlocker.
1. UIBlocker.blockScreen() // It blocks the screen.
2. UIBlocker.unblockScreen() // It unblocks the screen.
Now, i need to block the screen when JQGrid is being loaded. I want to ask where should i use UIBlocker.blockScreen() and UIBlocker.unblockScreen().?
According to my findings, UIBlocker.blockScreen should be used in beforeRequest event because it fires before requesting data. But there also some other events that fire before load like beforeProcessing,loadBeforeSend. So i am still confuse about it.
The second thing is where should i use unblockScreen. In loadComplete or in gridComplete?
Here, i found the order of execution of jqgrid,
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
Now suggest me, where should i use BlockScreen and unblockScreen?
loadui: "block"
option first of all. To give the best answer on your question one have to know which version of jqGrid you use and from which fork of jqGrid (free jqGrid, commercial Guriddo jqGrid JS or an old jqGrid in version <=4.7) – Kass