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
|
var foundProtocolRecord = Ext.data.Record.create([
{name: 'alias'}
]);
var protocolSearchDataStore = new Ext.data.Store({
proxy: new Ext.data.ScriptTagProxy({
url: '<c:url value="/secure/getProtocolList.htm"/>'
}),
reader: new Ext.data.JsonReader({
root: 'rows',
totalProperty: 'totalCount',
id: 'id'
}, foundProtocolRecord
),
sortInfo: {
field: 'alias',
direction: 'ASC'
}
});
var protocolSearchResultTemplate = new Ext.XTemplate(
'<tpl for="."><div class="search-item">',
'<h3><img src="<c:url value="/img/study.gif"/>"/> <spring:message code="dataEntryMgmt.alias"/>{alias}</h3>',
'</div></tpl>'
);
new Ext.form.ComboBox({
id: 'protocolSearch',
name: 'protocolSearch',
hideLabel: true,
store: protocolSearchDataStore,
displayField:'alias',
forceSelection : true,
typeAhead: false,
loadingText: '<spring:message code="dataEntryMgmt.protocolSearchLoadText"/>',
width: 175,
minChars: 3,
hideTrigger:true,
tpl: protocolSearchResultTemplate,
itemSelector: 'div.search-item',
onSelect: function(record) {
var centerSearch = Ext.getCmp("centerSearch");
centerSearch.store.proxy.url = '/secure/getCenterList.htm?protocolId='+record.id;
centerSearch.disabled = false;
var subjectTree = Ext.getCmp("subjectTreeView");
subjectTree.dataUrl = './getSubjectsTreeNodes.htm';
var rootNode = Ext.getCmp("subjectTreeView").root;
rootNode.removeAll();
var findASubject = Ext.getCmp("findASubject");
findASubject.reset();
this.collapse();
}
}) |
Partager