Last page update: November 23, 2011
type: client-side controller
The dataController belongs to client-side controllers family.
- GnrDomSrc_dojo_11.dataController(script=None, **kwargs)¶
Create a dataController and returns it. dataController allows to execute Javascript code
Parameters:
- script – the Javascript code that datacontroller has to execute.
- **kwargs – _init, _onStart, _timing. For more information, check the controllers’ common attributes section
commons attributes:
For commons attributes (_init, _onStart, _timing) see controllers’ common attributes
We show you two different syntaxes for the dataController:
class GnrCustomWebPage(object): def main(self,root,**kwargs): bc = pane.borderContainer(height='200px') fb = bc.formbuilder(cols=2,datapath='test1') # First syntax fb.dataController("SET .aaa='positive number'" ,_if='shooter>=0', _else="SET .aaa='negative number'",shooter='^.x') fb.numberTextbox(value='^.x',lbl='x') fb.textbox(value='^.aaa',margin='10px',lbl='aaa') # Second syntax fb.dataController("""if(shooter>=0){SET .bbb='positive number';} else{SET .bbb='negative number';}""", shooter='^.y') fb.numberTextbox(value='^.y',lbl='y') fb.textbox(value='^.bbb',margin='10px',lbl='bbb')