A little note on your code: There is an error in the beforesync event: the function must return true, else sync() will not get fired. I don't think this is the only problem. Since ExtJs is usually extensive code, I cannot tell you what is the reason of your problem....
Trigger is what you need here. Create a trigger that will be fired each time an update is done on s_articles_details Refer to the new value using the NEW keyword in the body of the trigger. According to the new value, do your condition, and update/insert the correct values...