Permalink
Browse files

Implements CTK.RadioGroupCfg()

git-svn-id: svn://cherokee-project.com/CTK/trunk@6748 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 10cd5bf commit f560d6ce04991faa10f27ebb98c4d02615640a98 @alobbs alobbs committed Jun 8, 2011
Showing with 21 additions and 2 deletions.
  1. +20 −1 CTK/Radio.py
  2. +1 −1 CTK/__init__.py
View
@@ -58,6 +58,26 @@ def Render (self):
return render
+class RadioGroupCfg (Box):
+ def __init__ (self, key, options, _props={}):
+ Box.__init__ (self)
+
+ self.props = _props.copy()
+ self._options = options
+
+ if not 'id' in self.props:
+ self.props['id'] = 'RadioGroup_%s' %(self.uniq_id)
+
+ for o in options:
+ val, desc = o
+
+ props = self.props.copy()
+ props['name'] = key
+ props['value'] = val
+
+ self += RadioText (desc, props)
+
+
class RadioText (Box):
def __init__ (self, txt, props={}):
Box.__init__ (self)
@@ -67,5 +87,4 @@ def __init__ (self, txt, props={}):
self.text = Box ({'class': 'radio-text'}, RawHTML(txt))
self += self.text
-
self.text.bind('click', "$('#%s').attr('checked', true);" %(self.radio.id))
View
@@ -64,7 +64,7 @@
from List import List, ListEntry
from ProgressBar import ProgressBar
from Downloader import Downloader, DownloadEntry_Factory
-from Radio import Radio, RadioText
+from Radio import Radio, RadioText, RadioGroupCfg
from XMLRPCProxy import XMLRPCProxy
from AjaxUpload import AjaxUpload, AjaxUpload_Generic
from Paginator import Paginator

0 comments on commit f560d6c

Please sign in to comment.