Skip to content

Commit

Permalink
WIP re #26.
Browse files Browse the repository at this point in the history
  • Loading branch information
JP Klein committed Aug 5, 2013
1 parent 5c98d8a commit e5447af
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 15 deletions.
34 changes: 27 additions & 7 deletions App.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Ext.define 'RallyPokerApp', {
@CurrentStory = Ext.create 'Rally.data.WsapiDataStore', {
model: 'userstory'
limit: 1,
fetch: ['ObjectID', 'LastUpdateDate', 'Description', 'Attachments', 'Notes', 'Discussion', 'PlanEstimate']
fetch: ['ObjectID', 'Name', 'LastUpdateDate', 'Description', 'Attachments', 'Notes', 'Discussion', 'PlanEstimate']
}
@StoryPage = Ext.create 'Ext.view.View', {
store: @CurrentStory
Expand Down Expand Up @@ -261,6 +261,11 @@ Ext.define 'RallyPokerApp', {
fieldLabel: 'Planning Points'
name: 'PlanEstimate'
allowBlank: true
listeners:
scope: @
specialkey: (field, e) ->
# @todo replace with call to submit function
@PointForm.submit() if e.getKey() is e.ENTER
}]

buttons: [{
Expand All @@ -273,16 +278,31 @@ Ext.define 'RallyPokerApp', {
handler: ->
`var form = this.up('form').getForm()`
if form.isValid()
form.submit
success: (form, action) ->
Ext.Msg.alert 'Success', action.result.msg
# form.submit
# success: (form, action) ->
# debugger
# Ext.Msg.alert 'Success', action.result.msg
# return
# failure: (form, action) ->
# debugger
# Ext.Msg.alert 'Failed', action.result.msg
# return
debugger
form.updateRecord()
# alert 'record updated?'
form.getRecord().store.sync
success: (batch, options) ->
alert 'Success'
return
failure: (form, action) ->
Ext.Msg.alert 'Failed', action.result.msg
failure: (batch, options) ->
alert 'Failure'
return
return
else
alert 'form invalid'
}]
# renderTo: Ext.getBody()
@down('#storyview').add @PointForm

_onStoryPageRefresh = (view) ->
@PointForm.loadRecord(@CurrentStory.getAt 0)
return
Expand Down
27 changes: 19 additions & 8 deletions App.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e5447af

Please sign in to comment.