Example of the NotifyStateChanged Notification

The following code is an example usage of the NotifyStateChanged notification:

this.AttachNotificationHandler(consts.get("SWE_PROP_BC_NOTI_STATE_CHANGED"), 
function (propSet){ 
var type = propSet.GetProperty("type");    
var value = propSet.GetProperty("value");    
// This is just an example. Switch-case is preferred if multiple types need to    
// have custom logic    
if (type === "cr" || type === "CurRowNum"){    
// Current Row has changed at the server.    
if (value === this.Get("MyPreviouslyStoredActiveRow")){    
// Or not! What's going on. Something wrong with my logic?    
}    
}    
if (type === "nr" || type === "NumRows"){    
if (parseInt(value) > 1000){    
// Woah, this user seems to be going through a lot of records!    
// Shouldn't she be using the query function?    
this.SetProperty ("AlertUser", true);    
}    
}    
...    
...    
});