Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
senchatouch-notes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
senchatouch-notes
Commits
26040b8c
Commit
26040b8c
authored
Apr 15, 2013
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Sencha Touch:
Creating new Notes now working except for REST interface
parent
681e70a5
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
52 deletions
+37
-52
app.js
www/app.js
+1
-3
NoteDetailController.js
www/app/controller/NoteDetailController.js
+0
-23
NoteListController.js
www/app/controller/NoteListController.js
+0
-20
NoteNavigationController.js
www/app/controller/NoteNavigationController.js
+24
-0
NoteStore.js
www/app/store/NoteStore.js
+1
-1
NoteDetail.js
www/app/view/NoteDetail.js
+10
-1
NoteList.js
www/app/view/NoteList.js
+1
-4
No files found.
www/app.js
View file @
26040b8c
...
@@ -30,9 +30,7 @@ Ext.application({
...
@@ -30,9 +30,7 @@ Ext.application({
],
],
controllers
:
[
controllers
:
[
'UserNavigationController'
,
'UserNavigationController'
,
'NoteNavigationController'
,
'NoteNavigationController'
'NoteListController'
// 'NoteDetailController'
],
],
// Main function: Load the various panels
// Main function: Load the various panels
...
...
www/app/controller/NoteDetailController.js
deleted
100644 → 0
View file @
681e70a5
Ext
.
define
(
'PO.controller.NoteDetailController'
,
{
extend
:
'Ext.app.Controller'
,
xtype
:
'noteDetailController'
,
config
:
{
refs
:
{
noteDetail
:
'noteDetail'
},
control
:
{
'noteDetail'
:
{
activate
:
'onActivate'
}
}
},
onActivate
:
function
(
obj
,
rec
)
{
var
form
=
this
.
getNoteDetail
();
var
data
=
form
.
getData
();
console
.
log
(
'NoteDetailController.onActivate: data='
+
data
);
form
.
setValues
(
data
);
form
.
setRecord
(
rec
);
}
});
www/app/controller/NoteListController.js
deleted
100644 → 0
View file @
681e70a5
Ext
.
define
(
'PO.controller.NoteListController'
,
{
extend
:
'Ext.app.Controller'
,
xtype
:
'noteListController'
,
config
:
{
refs
:
{
},
control
:
{
'noteList'
:
{
activate
:
'onActivate'
}
}
},
// Load the store on-demand in order to fix iPhone loading issue
onActivate
:
function
()
{
Ext
.
getStore
(
'NoteStore'
).
load
();
}
});
www/app/controller/NoteNavigationController.js
View file @
26040b8c
...
@@ -6,12 +6,35 @@ Ext.define('PO.controller.NoteNavigationController', {
...
@@ -6,12 +6,35 @@ Ext.define('PO.controller.NoteNavigationController', {
noteNavigationView
:
'noteNavigationView'
noteNavigationView
:
'noteNavigationView'
},
},
control
:
{
control
:
{
'noteNavigationView'
:
{
activate
:
'onActivateNavigationView'
},
'noteList'
:
{
'noteList'
:
{
disclose
:
'showDetail'
disclose
:
'showDetail'
}
}
}
}
},
},
// Initialization of the Container - add a button
// The NavigationView itself doesn't seem to allow for this type of customization
onActivateNavigationView
:
function
(
navView
)
{
var
navBar
=
Ext
.
ComponentQuery
.
query
(
'noteNavigationView'
)[
0
].
getNavigationBar
();
navBar
.
add
({
xtype
:
'button'
,
text
:
'New Note'
,
align
:
'right'
,
handler
:
function
()
{
console
.
log
(
'NoteListController: New Note button pressed'
);
navView
.
push
({
xtype
:
'noteDetail'
});
}
});
},
// "Disclose" Event - somebody pressed on the -> button at the list
// Create a new instance of the noteDetail page and push on the top
// of the stack
showDetail
:
function
(
list
,
record
)
{
showDetail
:
function
(
list
,
record
)
{
var
view
=
this
.
getNoteNavigationView
();
var
view
=
this
.
getNoteNavigationView
();
view
.
push
({
view
.
push
({
...
@@ -20,5 +43,6 @@ Ext.define('PO.controller.NoteNavigationController', {
...
@@ -20,5 +43,6 @@ Ext.define('PO.controller.NoteNavigationController', {
record
:
record
record
:
record
});
});
}
}
});
});
www/app/store/NoteStore.js
View file @
26040b8c
...
@@ -3,7 +3,7 @@ Ext.define('PO.store.NoteStore', {
...
@@ -3,7 +3,7 @@ Ext.define('PO.store.NoteStore', {
storeId
:
'noteStore'
,
storeId
:
'noteStore'
,
config
:
{
config
:
{
model
:
'PO.model.Note'
,
model
:
'PO.model.Note'
,
autoLoad
:
fals
e
,
autoLoad
:
tru
e
,
sorters
:
'last_name'
,
sorters
:
'last_name'
,
grouper
:
{
grouper
:
{
...
...
www/app/view/NoteDetail.js
View file @
26040b8c
...
@@ -40,11 +40,20 @@ Ext.define('PO.view.NoteDetail', {
...
@@ -40,11 +40,20 @@ Ext.define('PO.view.NoteDetail', {
text
:
'Save'
,
text
:
'Save'
,
ui
:
'confirm'
,
ui
:
'confirm'
,
handler
:
function
()
{
handler
:
function
()
{
console
.
log
(
'NoteDetail: Button "Save" pressed:'
);
// Save the form values to the record.
// Save the form values to the record.
// The record was set by the NoteNavigationController
// The record was set by the NoteNavigationController
var
form
=
this
.
up
(
'formpanel'
);
var
form
=
this
.
up
(
'formpanel'
);
var
values
=
form
.
getValues
();
var
rec
=
form
.
getRecord
();
var
rec
=
form
.
getRecord
();
rec
.
set
(
form
.
getValues
());
// Did we create a completely new note?
if
(
typeof
rec
===
"undefined"
||
rec
==
null
)
{
rec
=
Ext
.
ModelManager
.
create
(
values
,
'PO.model.Note'
);
}
rec
.
set
(
values
);
rec
.
save
();
rec
.
save
();
// Return to the list of notes page
// Return to the list of notes page
...
...
www/app/view/NoteList.js
View file @
26040b8c
...
@@ -4,7 +4,6 @@ Ext.define('PO.view.NoteList', {
...
@@ -4,7 +4,6 @@ Ext.define('PO.view.NoteList', {
requires
:
[
'PO.store.NoteStore'
],
requires
:
[
'PO.store.NoteStore'
],
config
:
{
config
:
{
title
:
'NoteList'
,
title
:
'NoteList'
,
iconCls
:
'star'
,
iconCls
:
'star'
,
itemTpl
:
'<div class="contact2">{note}</div>'
,
itemTpl
:
'<div class="contact2">{note}</div>'
,
...
@@ -13,8 +12,6 @@ Ext.define('PO.view.NoteList', {
...
@@ -13,8 +12,6 @@ Ext.define('PO.view.NoteList', {
indexBar
:
true
,
indexBar
:
true
,
store
:
'NoteStore'
,
store
:
'NoteStore'
,
onItemDisclosure
:
true
onItemDisclosure
:
true
}
}
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment