vendredi 31 octobre 2014

on change event datepicker in Ext.form.DateField not working


Vote count:

0




I have html span for datepicker like this



<span id="spanLimitFBClaim"></span>


then i call it's js



$("#spanLimitPaymentDate").datepicker("LimitPaymentDate")


datepicker comes form another global.js



$.fn.datepicker = function (id) {
var mydate = new Ext.form.DateField({
xtype: 'datepicker',
format: 'd-M-Y',
margin: '2 0 2 0',
renderTo: Ext.get($(this).attr("id")),
cls: 'sa-datepicker',
inputId: id,
value: new Date()
});
$("#" + id).attr("readonly", true);
}


it is works. the problem is. i want to get change event. i try to add in global js the listener like this



$.fn.datepicker = function (id) {
var mydate = new Ext.form.DateField({
xtype: 'datepicker',
format: 'd-M-Y',
margin: '2 0 2 0',
renderTo: Ext.get($(this).attr("id")),
cls: 'sa-datepicker',
inputId: id,
value: new Date(),
listeners: {
select: function () {
console.log('Date selected: ', this.getValue());
}
}
});
$("#" + id).attr("readonly", true);
}


and it works. i see the value on global.js (console.log) the problem is how to add it in my span (from the first js). because i do below code is not working



$("#spanLimitPaymentDate").datepicker("LimitPaymentDate", {
listeners: {
select: function () {
console.log('Date selected: ', this.getValue());
}
}
});


i'm very newbie in ext.js :(


Many thanks



asked 1 min ago







on change event datepicker in Ext.form.DateField not working

Aucun commentaire:

Enregistrer un commentaire