-
7 Mar 2011 9:00 AM #1
toggle button pressed
toggle button pressed
I'm having trouble handling the toggle event of a button.
This is what I'm trying but it is not working:
Anyone know what I'm doing wrong?Code:toggleHandler: function (btn, pressed) { if (pressed) { notices.noticeStatusStore.removeAll(); notices.noticeStatusStore.setBaseParam('showAll', 'no'); notices.noticeStatusStore.reload(); } else { notices.noticeStatusStore.removeAll(); notices.noticeStatusStore.setBaseParam('showAll', 'yes'); notices.noticeStatusStore.reload(); } }
-
7 Mar 2011 2:38 PM #2
set a debug point inside the handler. Look if notices is known inside the handler.
vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
7 Mar 2011 4:03 PM #3
yeah it works once or rather once the toggle button is pressed my baseParam is always no. even if I toggle the button back to it's original state. the handler fires every time the button is pressed but pressed is always true in the if statement.
-
7 Mar 2011 4:06 PM #4
oops ok the handler function is working I am getting true and fale but setBaseParam is not working the second time. showAll remains 'no' when I reload the store.
-
7 Mar 2011 4:23 PM #5
SOLVED kind of
SOLVED kind of
It looks like I'm seeing this behaviour because I'm using reload on the store it must be caching the last value. load worked except there were other params that I wanted to retain.
by doing this:
it fixed my problem and the other params retained there value. that I do not specifically list. so I guess that will work for now. weird.Code:toggleHandler: function (btn, pressed) { if (pressed) { notices.noticeStatusStore.removeAll(); notices.noticeStatusStore.setBaseParam('showAll', 'no'); notices.noticeStatusStore.reload({ params: { start: 0, limit: 35 } }); } else { notices.noticeStatusStore.removeAll(); notices.noticeStatusStore.setBaseParam('showAll', 'yes'); notices.noticeStatusStore.reload({ params: { start: 0, limit: 35 } }); } }
Similar Threads
-
[SOLVED] Toggle button's pressed parameter return an object
By ironlion in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 5 Aug 2010, 9:22 PM -
Is there a way to set the pressed property of a button?
By StevenInc in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 1 Dec 2009, 12:11 PM -
Pressed Toggle State in Toolbar Button
By Domitian in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 16 May 2007, 9:00 PM -
Toggle button: change button icon when pressed?
By dbadke in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 26 Mar 2007, 7:14 AM


Reply With Quote