Results 1 to 3 of 3

Thread: Changes in 3.1

  1. #1
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,676
    Vote Rating
    9
      0  

    Default Changes in 3.1

    Hi,

    just wondering but after update the object structure in handlers of datepicker changed completely, so i had to adjust my scripts. What is the reason for, and which drastic changes are done too? Is there any doc or summary which structures changed too? It's hard to get this if you stop read the forum for a short while, and changes are not backward compatible.
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,593
    Vote Rating
    874
      0  

    Default

    The public API for the DatePicker didn't change, if I remember correctly. What are you referring to?
    Evan Trimboli
    Twitter - @evantrimboli

  3. #3
    Sencha Premium Member steffenk's Avatar
    Join Date
    Jul 2007
    Location
    Haan, Germany
    Posts
    2,676
    Vote Rating
    9
      0  

    Default

    This is the code which worked well with 3.0 and stopped working with 3.1:
    Code:
    var menu = new Ext.menu.DateMenu({
    	id:			'p' + element.dom.id,
    	format:		format[index],
    	value:		Date.parseDate(element.dom.value, format[index]),
    	handler: 	function(picker, date){
    		var relElement = Ext.getDom(picker.id.substring(1));
    		relElement.value = date.format(format[index]);
    		if (Ext.isFunction(relElement.onchange)) {
    			relElement.onchange.call(relElement);
    		}
    	},
    	listeners:	{
    		beforeshow:	function(picker) {
    			var relElement = Ext.getDom(picker.id.substring(1));
    			if (relElement.value) {
    				Ext.getCmp('p' + relElement.id).setValue(Date.parseDate(relElement.value, format[index]));
    			}
    		}
    	}
    });
    Here is the new code that works now:
    Code:
    var menu = new Ext.menu.DateMenu({
    	id:			'p' + element.dom.id,
    	format:		format[index],
    	value:		Date.parseDate(element.dom.value, format[index]),
    	handler: 	function(picker, date){
    		var relElement = Ext.getDom(picker.ownerCt.id.substring(1));
    		relElement.value = date.format(format[index]);
    		if (Ext.isFunction(relElement.onchange)) {
    			relElement.onchange.call(relElement);
    		}
    	},
    	listeners:	{
    		beforeshow:	function(picker) {
    			var relElement = Ext.getDom(picker.picker.ownerCt.id.substring(1));
    			if (relElement.value) {
    				picker.picker.setValue(Date.parseDate(relElement.value, format[index]));
    			}
    		}
    	}
    });
    The change is the picker object in handler and beforeshow listener.
    Last edited by mystix; 27 Jan 2010 at 1:21 AM. Reason: highlighted changes in red for readability
    vg Steffen
    --------------------------------------
    Release Manager of TYPO3 4.5

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •