Permalink
Browse files

Modified Data page

  • Loading branch information...
1 parent c625b22 commit 9453a157063a8d4434b68d8f4b06577b1e07cc12 @toantran committed Mar 24, 2012
Showing with 22 additions and 4 deletions.
  1. +13 −1 coffee/public/js/data.coffee
  2. +8 −2 public/js/data.js
  3. +1 −1 views/data.jade
@@ -6,6 +6,7 @@ jQuery ($) ->
formsubmit = ->
formdata = {}
+ form = $(@)
for item in $(@).serializeArray()
do (item) ->
@@ -14,7 +15,18 @@ jQuery ($) ->
$.post('customeradd', formdata)
.success (data) ->
if data?.success
- console.log 'OK'
+ el = $.el('tr', {}, [
+ $.el('td', {}, [ $.el('div.label.label-success', {}, ['new']) ]),
+ $.el('td', {}, [ data?.customer?.name]),
+ $.el('td', {}, [ data?.customer?.contact]),
+ $.el('td', {}, [ data?.customer?.address]),
+ $.el('td', {}, ['']),
+ $.el('td', {}, [''])
+ ])
+
+ $('tbody#customer-list').prepend el
+
+ $('form#customer-form input').val ''
return false
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -20,7 +20,7 @@
td Address
td Additional Info
td
- tbody
+ tbody#customer-list
- if (typeof customers != 'undefined')
!= partial('customer', customers)
script(type='text/javascript', src='js/data.js')

0 comments on commit 9453a15

Please sign in to comment.