1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
    babar.sajjad is on a distinguished road

      0  

    Exclamation Toggle Bug

    Toggle Bug


    I defined toggle control like this
    Code:
    var toggle_meal = new Ext.form.Toggle({
    	id: 'toggle_me',
    	label: 'Log Meal',
    	cls: 'rounded bordAll',
    	minValue: 0,
    	maxValue: 1,
    	value:1
    });
    when i call toggle_meal.setValue(1); i get this error Uncaught TypeError: Cannot read property 'offsetBoundary' of undefined

    Does not know how to set values dynamically in toggle.

  2. #2
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
    stargieg is on a distinguished road

      0  

    Default


    Quote Originally Posted by babar.sajjad View Post
    I defined toggle control like this

    Does not know how to set values dynamically in toggle.
    Is there any solution or workaround for this?

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
    babar.sajjad is on a distinguished road

      0  

    Default


    i call toggle setValue function in panel show listener, like this
    Code:
    myPanel = Ext.extend(Ext.Panel, {
    	scroll: 'vertical',
    	layout: 'auto',
    	cls: 'green-bg',
    	items: [meal_basic_data_view,toggle_meal,remain_meal_data_view],
    	listeners:{
    		show: function(){
    			toggle_meal.setValue(1);
    		}	
    	}
    	
    });
    its working fine now

  4. #4
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
    stargieg is on a distinguished road

      0  

    Default


    Quote Originally Posted by babar.sajjad View Post
    i call toggle setValue function in panel show listener, like this
    Code:
    myPanel = Ext.extend(Ext.Panel, {
    	scroll: 'vertical',
    	layout: 'auto',
    	cls: 'green-bg',
    	items: [meal_basic_data_view,toggle_meal,remain_meal_data_view],
    	listeners:{
    		show: function(){
    			toggle_meal.setValue(1);
    		}	
    	}
    	
    });
    its working fine now
    Hm. That does not work for me.
    That is my Formpannel.
    Code:
    var formLeft = new Ext.form.FormPanel({
        cls: 'cards',
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
        defaults: {
            flex: 1
        },
        items: [{
    		xtype: 'fieldset',
    		title: 'DIMMEN',
    		defaults: { 
    			xtype: 'sliderfield',
    			labelAlign: 'top', 
    			animate: true, 
    			showAnimation: true,
    			minValue: 0,
    			maxValue: 100,
    			value: 0,
    			cls: '',
    			listeners:{
            				change:	function (sliderfield,thumb,oldValue,newValue) {
    						change_event(sliderfield,thumb,oldValue,newValue);
            				}
    				}
    		},
    		items: [{
    			id: '9_bel_de_1_hw_R601',
    			label: 'Deckenspots Kreis 1'
    		},
    		{
    			id: '10_bel_de_2_hw_R601',
    			label: 'Pendelleuchte'
    		},
    		{
    			id: '11_bel_de_3_hw_R601',
    			label: 'Deckenspots Kreis 2'
    		}]
    	}]
    });
    I have a externel script with
    Code:
    window.setTimeout(timer, interval);
    and

    Code:
    var element = Ext.getCmp('9_bel_de_1_hw_R601');
    oldvalueStr = element.getValue();
    console.log('oldvalueStr');
    element.setValue(10);
    I can not read the value with getValue() and can not write with setValue().

  5. #5
    Sencha User
    Join Date
    Feb 2011
    Posts
    4
    Vote Rating
    0
    stargieg is on a distinguished road

      0  

    Default


    It works! :-)

    I add a listner with setTimout function.

    Code:
    var formLeft = new Ext.form.FormPanel({
        cls: 'cards',
        layout: {
            type: 'vbox',
            align: 'stretch'
        },
        defaults: {
            flex: 1
        },
        items: [{
    		xtype: 'fieldset',
    		title: 'DIMMEN',
    		defaults: { 
    			xtype: 'sliderfield',
    			labelAlign: 'top', 
    			animate: true, 
    			showAnimation: true,
    			minValue: 0,
    			maxValue: 100,
    			value: 0,
    			cls: '',
    			listeners:{
    				afterrender: function(comp) {
    					setTimeout(timer_el, 1000,comp);
    				},
            			change:	function (sliderfield,thumb,oldValue,newValue) {
    					change_event(sliderfield,thumb,oldValue,newValue);
    				},
    			},
    		items: [{
    			id: '9_bel_de_1_hw_R601',
    			label: 'Deckenspots Kreis 1'
    		},
    		{
    			id: '10_bel_de_2_hw_R601',
    			label: 'Pendelleuchte'
    		},
    		{
    			id: '11_bel_de_3_hw_R601',
    			label: 'Deckenspots Kreis 2'
    		}]
    	}]
    });
    I have a externel script with timer_el()
    and successful setValue() end getValue()

    Code:
    function timer_el(elName) {
    	var elNameStr=elName.getName();
    	if (vdb[elNameStr]) {
    		var elNameVal=elName.getValue();
    		if (elNameVal != vdb[elNameStr]) {
    				elName.setValue(vdb[elNameStr]);
    		}
    	}
    	setTimeout(timer_el, 1000,elName);
    }
    THX for the hints

  6. #6
    Sencha User
    Join Date
    Dec 2010
    Posts
    81
    Vote Rating
    0
    babar.sajjad is on a distinguished road

      0  

    Default


    thats gr8

Similar Threads

  1. On/Off toggle buttom
    By tomalex0 in forum Sencha Touch 1.x: Examples and Showcases
    Replies: 26
    Last Post: 24 Aug 2012, 4:04 AM
  2. Align the toggle to right.
    By blessan in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 24 Jan 2011, 5:03 AM
  3. Toggle component's setValue & toggle functions give an error
    By ncanton in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 28 Oct 2010, 10:35 PM
  4. How to Toggle between tabs
    By AmitOlsys in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 26 Aug 2008, 10:21 PM
  5. Need help with Toggle
    By kar in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 30 May 2008, 9:58 AM

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."