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

- Sencha Touch

parent 269fda4b
......@@ -3,8 +3,8 @@ Ext.application({
name: 'PO',
models: ['Note','User'],
stores: ['NoteStore', 'UserStore', 'ContactStore'],
views: ['UserList', 'UserDetail', 'BlogList', 'UserNavigationView'],
controllers: ['UserNavigationController'],
views: ['UserList', 'UserDetail', 'BlogList', 'NoteList', 'UserNavigationView'],
controllers: ['UserNavigationController', 'NoteListController'],
requires: [
'Ext.MessageBox',
......@@ -29,7 +29,7 @@ Ext.application({
}, {
xtype: 'blogList',
}, {
xtype: 'userList',
xtype: 'noteList',
}, {
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', {
config: {
fields: [
'id',
'object_name',
'note',
'object_id',
'note_type_id'
],
proxy: {
......@@ -15,17 +16,17 @@ Ext.define('PO.model.Note', {
extraParams: {
format: 'json', // Tell the ]po[ REST to return JSON data.
deref_p: '1',
columns: 'note_type_id'
columns: 'note,note_type_id'
},
reader: {
type: 'json', // Tell the Proxy Reader to parse JSON
root: 'data', // Where do the data start in the JSON file?
totalProperty: 'total' // Total number of tickets for pagination
},
writer: {
writer: {
type: 'json' // Allow Sencha to write ticket changes
}
}
}
}
});
Ext.define('PO.store.NoteStore', {
extend: 'Ext.data.Store',
requires: 'Ext.DateExtras',
storeId: 'noteStore',
config: {
model: 'PO.model.Note',
sorters: [
{
property: 'note_type_id',
direction: 'ASC'
},
{
property: 'object_name',
direction: 'ASC'
}
]
autoLoad: false,
sorters: 'last_name',
grouper: {
groupFn: function(record) {
var fn = record.get('note');
if (fn == null) { return 'a'; }
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', {
'PO.view.UserDetail'
],
config: {
title: 'UserNavView',
title: 'Users',
iconCls: 'star',
items: [{
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