Commit 90a223ee authored by Frank Bergmann's avatar Frank Bergmann

- Sencha Touch

parent 269fda4b
...@@ -3,8 +3,8 @@ Ext.application({ ...@@ -3,8 +3,8 @@ Ext.application({
name: 'PO', name: 'PO',
models: ['Note','User'], models: ['Note','User'],
stores: ['NoteStore', 'UserStore', 'ContactStore'], stores: ['NoteStore', 'UserStore', 'ContactStore'],
views: ['UserList', 'UserDetail', 'BlogList', 'UserNavigationView'], views: ['UserList', 'UserDetail', 'BlogList', 'NoteList', 'UserNavigationView'],
controllers: ['UserNavigationController'], controllers: ['UserNavigationController', 'NoteListController'],
requires: [ requires: [
'Ext.MessageBox', 'Ext.MessageBox',
...@@ -29,7 +29,7 @@ Ext.application({ ...@@ -29,7 +29,7 @@ Ext.application({
}, { }, {
xtype: 'blogList', xtype: 'blogList',
}, { }, {
xtype: 'userList', xtype: 'noteList',
}, { }, {
xtype: 'userNavigationView', xtype: 'userNavigationView',
}, { }, {
......
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();
}
});
...@@ -3,7 +3,8 @@ Ext.define('PO.model.Note', { ...@@ -3,7 +3,8 @@ Ext.define('PO.model.Note', {
config: { config: {
fields: [ fields: [
'id', 'id',
'object_name', 'note',
'object_id',
'note_type_id' 'note_type_id'
], ],
proxy: { proxy: {
...@@ -15,17 +16,17 @@ Ext.define('PO.model.Note', { ...@@ -15,17 +16,17 @@ Ext.define('PO.model.Note', {
extraParams: { extraParams: {
format: 'json', // Tell the ]po[ REST to return JSON data. format: 'json', // Tell the ]po[ REST to return JSON data.
deref_p: '1', deref_p: '1',
columns: 'note_type_id' columns: 'note,note_type_id'
}, },
reader: { reader: {
type: 'json', // Tell the Proxy Reader to parse JSON type: 'json', // Tell the Proxy Reader to parse JSON
root: 'data', // Where do the data start in the JSON file? root: 'data', // Where do the data start in the JSON file?
totalProperty: 'total' // Total number of tickets for pagination totalProperty: 'total' // Total number of tickets for pagination
}, },
writer: { writer: {
type: 'json' // Allow Sencha to write ticket changes type: 'json' // Allow Sencha to write ticket changes
} }
} }
} }
}); });
Ext.define('PO.store.NoteStore', { Ext.define('PO.store.NoteStore', {
extend: 'Ext.data.Store', extend: 'Ext.data.Store',
requires: 'Ext.DateExtras', storeId: 'noteStore',
config: { config: {
model: 'PO.model.Note', model: 'PO.model.Note',
sorters: [ autoLoad: false,
{ sorters: 'last_name',
property: 'note_type_id',
direction: 'ASC' grouper: {
}, groupFn: function(record) {
{ var fn = record.get('note');
property: 'object_name', if (fn == null) { return 'a'; }
direction: 'ASC' return fn[0];
} }
] },
sorters: [{
property: 'note',
direction: 'ASC'
}],
proxy: {
type: 'rest',
url: '/intranet-rest/im_note',
appendId: true,
extraParams: {
format: 'json'
},
reader: {
type: 'json',
rootProperty: 'data'
}
}
} }
}); });
Ext.define('PO.view.NoteList', {
extend: 'Ext.List',
xtype: 'noteList',
requires: ['PO.store.NoteStore'],
config: {
title: 'NoteList',
iconCls: 'star',
itemTpl: '<div class="contact2">{note}</div>',
disclosure: true,
grouped: true,
indexBar: true,
store: 'NoteStore',
onItemDisclosure: true
}
});
...@@ -6,7 +6,7 @@ Ext.define('PO.view.UserNavigationView', { ...@@ -6,7 +6,7 @@ Ext.define('PO.view.UserNavigationView', {
'PO.view.UserDetail' 'PO.view.UserDetail'
], ],
config: { config: {
title: 'UserNavView', title: 'Users',
iconCls: 'star', iconCls: 'star',
items: [{ items: [{
xtype: 'userList' xtype: 'userList'
......
# /packages/senchatouch-notes/www/index.tcl
#
# Copyright (c) 2003-2013 ]project-open[
# All rights reserved
ad_page_contract {
@author frank.bergmann@ticket-open.com
} {
}
# ---------------------------------------------------------------
# Defaults & Security
# ---------------------------------------------------------------
set current_user_id [ad_maybe_redirect_for_registration]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment