EXTJS: refactored code so that previous commit works on updates as well as create.