1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
| Ext.regModel('guests', {
fields: [
{ name: 'id', type: 'string' },
{ name: 'nom', type: 'string' },
{ name: 'sujet', type: 'string' },
{ name: 'message', type: 'string' }
]
});
storeQuestions = new Ext.data.Store({
model: 'guests',
storeId: "storeQuestions",
proxy: {
type: 'rest',
id: 'model',
url: '\questions.php?',
reader: {
type: 'json',
root: 'guests'
}
}
}),
var tplquestions = new Ext.XTemplate(
'<div id="fonds">',
'<tpl for=".">',
'<div class="rectangles">',
'<br> <br>',
'<center>',
'<span class="bulle bottom" id="stylish">',
'<table>',
'<tr>',
'<td>Question {id}</td>',
'<td>Sujet: {sujet}</td>',
'</tr>',
'<tr>',
'<td colspan="2"> {message}</td>',
'</tr>',
'</table>',
'</span>',
'</center>',
'<\div>',
'<br>',
'</tpl>',
'</div>',
'<br>'
),
panelbulle = new Ext.Panel({
id:'voirdonnees',
title: 'Questions ouvertes',
iconCls: 'user',
iconMask: true,
frame:true,
width:535,
autoHeight:true,
collapsible:true,
layout:'fit',
items: new Ext.DataView({
store: storeQuestions,
tpl: tplquestions,
autoHeight:true,
multiSelect: true,
itemSelector: 'div.fonds',
emptyText: 'Pas de question pour le moment'
})
});
demos.Questions = new Ext.TabPanel({
fullscreen: true,
ui: 'light',
tabBar: {
dock: 'bottom',
layout: { pack: 'center'}
},
cardSwitchAnimation: {
type: 'slide'
},
dockedItems: [{
xtype: 'toolbar',
ui: 'light',
dock: 'top',
defaults: {
iconMask: true,
ui: 'plain'
},
items: [{
iconCls: 'refresh',
handler: function() {
var store = storeQuestions;
store.load();
}
}]
}],
items: [panelbulle]
}); |
Partager