Fix cancel button reference loss when it's not at direct child of file item.
Added a new option to allow a customized parser function.