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
|
var urlPatternList = './getPatternList.aspx';
// 1. instanciation de la combobox de patterns
var lignePatternFields = [
'id',
'name',
'tName',
'addMode',
'purge',
'patternFormatList'
];
var patternStore = new Ext.data.XmlStore({
proxy: new Ext.data.HttpProxy({ url: urlPatternList }),
remoteSort: false,
autoSave: false,
autoLoad: false,
fields: [
'id',
'name',
'tName',
'addMode',
'purge',
'patternFormatList'
],
record: 'pattern',
restfull: true
});
var patternList = new Ext.form.ComboBox({
fieldLabel: 'pattern à employer',
store: patternStore,
valueField: 'id',
displayField: 'name',
hiddenName: 'id',
mode: 'remote',
minChars : 0
});
// 2. création du panel de saisie
var centerPanel = new Ext.form.FormPanel( {
frame:true,
height:300,
region : "center",
title:'Saisie de nouveaux formats',
labelWidth : 200,
defaultType : 'textfield',
items : [ {
xtype : "textfield",
fieldLabel : '<bean:message key="format.nom"/>',
id : "user"
},
patternList,
{
xtype: 'fileuploadfield',
id: 'file',
emptyText: 'Choisissez un fichier',
name: 'file',
hideLabel:true,
width:450,
allowBlank:false,
blankText:'Veuillez choisir un fichier',
buttonCfg: {
text: '',
iconCls: 'upload-icon'
}
}],
bodyBorder:true
//buttonAlign:'center',
//buttons: [{
// text: 'Valider',
// handler:function(){
// upload(principalPanel,window);
//
// }
//}]
});
// 3. création du panel principal
var principalPanel = new Ext.Panel({
layout:'border',
items:[centerPanel],
id: 'formatsPanel',
html: '<div id="pageCenterDiv"></div>'
}); |
Partager