-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating example8 with major functionality, working up a chat applica…
…tion
- Loading branch information
Showing
14 changed files
with
245 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Ext.define('example8.model.Message', { | ||
|
||
extend: 'Ext.data.Model', | ||
fields: [ | ||
{ name: 'message', type: 'string' }, | ||
{ name: 'posted', type: 'string' }, | ||
{ name: 'username', type: 'string' }, | ||
{ name: 'ts', type: 'int' }, | ||
{ name: 'id', type: 'int' } | ||
] | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Ext.define('example8.model.Userlist', { | ||
|
||
extend: 'Ext.data.Model', | ||
fields: ['username','id'] | ||
|
||
}); |
17 changes: 17 additions & 0 deletions
17
zfapp/public/js/examples/example8/app/store/Messagelist.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Ext.define('example8.store.Messagelist', { | ||
|
||
extend: 'Ext.data.Store', | ||
model: 'example8.model.Message', | ||
|
||
proxy: { | ||
type: 'ajax', | ||
url: '/example/example8read/format/json', | ||
reader: { | ||
type: 'json', | ||
root: 'messages' | ||
} | ||
}, | ||
autoLoad: true, | ||
autoSync: true | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Ext.define('example8.store.Userlist', { | ||
|
||
extend: 'Ext.data.Store', | ||
model: 'example8.model.Userlist' | ||
|
||
}); |
30 changes: 30 additions & 0 deletions
30
zfapp/public/js/examples/example8/app/view/index/Chatinput.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Ext.define('example8.view.index.Chatinput',{ | ||
|
||
extend: 'Ext.panel.Panel', | ||
alias: 'widget.chatinput', | ||
border: false, | ||
height: 30, | ||
items: [ | ||
{ | ||
xtype: 'form', | ||
id: 'chatForm', | ||
url: '/example/example8submit/format/json', | ||
layout: 'column', | ||
border: false, | ||
bodyStyle: 'padding: 3px', | ||
items: [ | ||
{ | ||
xtype: 'textfield', | ||
name: 'chatMessage', | ||
id: 'chatMessage', | ||
columnWidth: .90, | ||
required: true | ||
}, | ||
{ | ||
xtype: 'button', | ||
text: 'Send' | ||
} | ||
] | ||
} | ||
] | ||
}); |
18 changes: 18 additions & 0 deletions
18
zfapp/public/js/examples/example8/app/view/index/Chatwin.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Ext.define('example8.view.index.Chatwin', { | ||
|
||
extend: 'Ext.panel.Panel', | ||
alias: 'widget.chatwin', | ||
title: 'Latest Chat Messages', | ||
layout: 'border', | ||
items: [ | ||
{ | ||
xtype: 'messagelist', | ||
region: 'center' | ||
}, | ||
{ | ||
xtype: 'chatinput', | ||
region: 'south' | ||
} | ||
] | ||
|
||
}); |
23 changes: 23 additions & 0 deletions
23
zfapp/public/js/examples/example8/app/view/index/Messagelist.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Ext.define('example8.view.index.Messagelist', { | ||
|
||
extend: 'Ext.grid.Panel', | ||
alias: 'widget.messagelist', | ||
|
||
//title : 'Sample Grid', | ||
store : 'Messagelist', | ||
|
||
hideHeaders: true, | ||
|
||
initComponent: function() { | ||
|
||
// column definition for the grid | ||
this.columns = [ | ||
{header:'Date',dataIndex:'posted',width:100}, | ||
{header:'User',dataIndex:'username',width:90}, | ||
{header:'Message',dataIndex:'message',flex:1} | ||
]; | ||
|
||
this.callParent(arguments); | ||
} | ||
|
||
}); |
27 changes: 27 additions & 0 deletions
27
zfapp/public/js/examples/example8/app/view/index/Userlist.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Ext.define('example8.view.index.Userlist', { | ||
|
||
/** Extend the default grid */ | ||
extend : 'Ext.grid.Panel', | ||
|
||
/** Assign an alias to the widget */ | ||
alias : 'widget.userlistgrid', | ||
|
||
/** Give the grid a title */ | ||
title : 'Current Users', | ||
|
||
/** The store to pull data from */ | ||
store : 'Userlist', | ||
|
||
/** Initialize the grid */ | ||
initComponent: function() { | ||
console.log('init sample grid'); | ||
|
||
// column definition for the grid | ||
this.columns = [ | ||
{header:'Username',dataIndex:'username',flex:1} | ||
]; | ||
|
||
this.callParent(arguments); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters