두 개의 날짜 필드가있는 양식이 있는데, 날짜 범위를 정의해야하므로 시작 부분이 끝날 수 없습니다. 그들은 둘 다 datepicker에 의해 만들어 지는데, 이것은 "end"에서 "start"이전의 날짜를 비활성화해야합니다. this 매뉴얼 페이지에 붙여 넣을 코드가 있지만 오류없이 페이지에이 코드를 붙여 넣을 수 없습니다. 어쩌면 내 페이지가 너무 복잡하기는하지만 그렇게 생각하지는 않는다. 다른 코드를 모두 작성하지 않고 codewithout을 붙여 넣을 위치를 알아 내지 못하는 것은 나만 생각한다. 다음은 내 페이지의 코드 :날짜 범위 vtype, 작동 방식을 이해할 수 없습니다. extjs 4
Ext.define('MyDesktop.count', {
extend: 'Ext.ux.desktop.Module',
requires: [
'Ext.ux.desktop.DatabaseModel',
//'Ext.ux.desktop.UserModel',
'Ext.data.TreeStore',
'Ext.layout.container.Accordion',
'Ext.toolbar.Spacer',
'Ext.tree.Panel'
],
id:'count',
init : function(){
this.launcher = {
text: 'count',
iconCls:'accordion'
};
},
createWindow : function(){
var App = this.app;
var desktop = this.app.getDesktop();
var win = desktop.getWindow('count-win');
if (!win) {
win = desktop.createWindow({
id: 'count-win',
title: 'count',
width: 350,
height: 200,
animCollapse: false,
maximizable: false,
resizable: false,
//constrainHeader: true,
//bodyBorder: true,
layout : 'anchor',
items:[
{
xtype : 'fieldset',
border: false,
defaultType: 'textfield',
items: [
{
xtype: 'datefield',
fieldLabel: 'Start date',
format: 'Ymd',
id:"start",
//altFormats: 'Ymd',
vtype: 'daterange',
endDateField: 'end'
},
{
xtype: 'datefield',
fieldLabel: 'End date',
format: 'Ymd',
id: "end",
//minValue: Ext.getCmp('start').getValue(),
//altFormats: 'm/d/Y',
vtype: 'daterange',
startDateField: 'start'
},
{
xtype: 'combo',
fieldLabel: 'Client',
id:"client",
hiddenName: 'client',
store: new Ext.data.SimpleStore({
data: [
['applix', 'applix'],
['banzai', 'banzai'],
['banzai-cooking', 'banzai - cooking'],
['integralAS', 'integralAS'],
['LinkSmart', 'LinkSmart'],
['nbcuniversal', 'nbcuniversal'],
['primenetwork', 'primenetwork'],
['quag', 'quag'],
['turnEU', 'turnEU'],
['turnUS', 'turnUS']
],
id: 0,
fields: ['value', 'text']
}),
valueField: 'value',
displayField: 'text',
triggerAction: 'all',
editable: false
}
]
}
],
buttons: [{
text: 'Submit',
handler: function() {
console.log(this);
start= Ext.util.Format.date(Ext.getCmp('start').getValue(),'Ymd');
end= Ext.util.Format.date(Ext.getCmp('end').getValue(),'Ymd');
//period = Ext.getCmp('period').value;
client = Ext.getCmp('client').value;
Ext.Ajax.request({
method : "GET",
url : 'http://whatever.com/count?client='+client+'&start='+start+'&end='+end,
timeout : 30000,
success :
function (response) {
//console.log(Ext.getCmp('to_add'))
Ext.Msg.alert(response.responseText);
desktop.getWindow('count-win').doClose();
}//handler
,
failure :
function(response) {
alert("Wrong request");
}
});
}
}]
});
}
return win;
}
});
vtypes 이미, 난 리스너 및/또는 코드의 모든 나머지를 멀리 절단없이 daterage 속성을 처리 할 수있는 기능을 내가해야 하는가를 넣어해야 어디입니까? 여기 예제에서와 같이 stackoverflow (하지만 tryed 및 양식 창을 더 이상 작동하지 않음) 또는 수동으로 코드를 사용해야합니까? 누구든지이 문제에 대해 경험이 있습니까?
이것을 확인하면 거의 동일합니다. 더 잘 이해할 수 있습니다. http://stackoverflow.com/questions/19959448/extjs-datefields-from-to-or-start-end-date-validations – kdaShivantha