FlexGrid with custom apply method - Pure JS