       _.each docs, (doc) ->
         doc = collection.findOne(doc._id)
         if doc? then latestDocs.push(doc)
-      latestValues = if docs.length > 1 then Form.getBulkValues(template, latestDocs) else docs[0]
+      latestValues =
+        if docs.length > 1 then Form.getBulkValues(template, latestDocs) else latestDocs[0]
       latestValues ?= {}
       latestValues = Objects.flattenProperties(latestValues)
       mergedValues = {}

      # if Form.isBulk()
      #   Form.setUpBulkFields()

      if @data?.docPromise? then Q.when(@data.docPromise).then => Form.mergeLatestDoc(@)
      
      formArgs.onRender?.apply(@, arguments)


      # event manually.
      $submit = Form.getSubmitButton(@)
      if $submit.closest('form').length == 0
        $submit.click =>
          Logger.debug('Submitting form...', formArgs)
          $form.submit()

      schemaInputs = Form.getSchemaInputs(@)

