Skip to content

Instantly share code, notes, and snippets.

@lsiden
Created December 8, 2009 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lsiden/251316 to your computer and use it in GitHub Desktop.
Save lsiden/251316 to your computer and use it in GitHub Desktop.
add_item: function() {
// create new LedgerEntry and add it to the list
var that = this;
var ledger_entry = EccapCalc.store.createRecord(EccapCalc.LedgerEntry, {
ledger: that.ledger,
});
// select new LedgerEntry in UI
this.selectObject(ledger_entry);
// activate inline editor once UI can repaint
this.invokeLater(function() {
var contentIndex = this.indexOf(ledger_entry);
var view = EccapCalc.mainPage.getPath(path_to_view + '.description.contentView');
var listItem = view.itemViewForContentIndex(contentIndex);
listItem.beginEditing();
});
return YES ;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment