-
11 Feb 2011 4:06 AM #1
Toggle Bug
Toggle Bug
I defined toggle control like this
when i call toggle_meal.setValue(1); i get this error Uncaught TypeError: Cannot read property 'offsetBoundary' of undefinedCode:var toggle_meal = new Ext.form.Toggle({ id: 'toggle_me', label: 'Log Meal', cls: 'rounded bordAll', minValue: 0, maxValue: 1, value:1 });
Does not know how to set values dynamically in toggle.
-
16 Feb 2011 3:16 AM #2
-
16 Feb 2011 3:34 AM #3
i call toggle setValue function in panel show listener, like this
its working fine nowCode: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); } } });
-
16 Feb 2011 5:46 AM #4
Hm. That does not work for me.
That is my Formpannel.
I have a externel script withCode: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' }] }] });
andCode:window.setTimeout(timer, interval);
I can not read the value with getValue() and can not write with setValue().Code:var element = Ext.getCmp('9_bel_de_1_hw_R601'); oldvalueStr = element.getValue(); console.log('oldvalueStr'); element.setValue(10);
-
17 Feb 2011 2:45 PM #5
It works! :-)
I add a listner with setTimout function.
I have a externel script with timer_el()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' }] }] });
and successful setValue() end getValue()
THX for the hintsCode: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); }
-
17 Feb 2011 3:11 PM #6
Similar Threads
-
On/Off toggle buttom
By tomalex0 in forum Sencha Touch 1.x: Examples and ShowcasesReplies: 26Last Post: 24 Aug 2012, 4:04 AM -
Align the toggle to right.
By blessan in forum Sencha Touch 1.x: DiscussionReplies: 2Last Post: 24 Jan 2011, 5:03 AM -
Toggle component's setValue & toggle functions give an error
By ncanton in forum Sencha Touch 1.x: DiscussionReplies: 0Last Post: 28 Oct 2010, 10:35 PM -
How to Toggle between tabs
By AmitOlsys in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 26 Aug 2008, 10:21 PM -
Need help with Toggle
By kar in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 30 May 2008, 9:58 AM


Reply With Quote