7.2.3. dataFormula

Last page update: November 23, 2011

type: client-side controller

The dataFormula belongs to client-side controllers family.

7.2.3.1. Definition

GnrDomSrc_dojo_11.dataFormula(path, formula, **kwargs)

Create a dataFormula and returns it. dataFormula allows to calculate a value through a formula.

Parameters:
  • path – the dataFormula’s path
  • formula – the dataFormula’s formula
  • **kwargs – formula parameters and other ones (CSS, etc)

commons attributes:

For commons attributes (_init, _onStart, _timing) see controllers’ common attributes

7.2.3.2. Examples

Example:

class GnrCustomWebPage(object):
    def main(self,root,**kwargs):
        fb = root.formbuilder(cols=2)
        fb.horizontalSlider(lbl='Base',value='^base',width='200px',minimum=1,maximum=100)
        fb.numberTextBox(value='^base',places=2)
        fb.horizontalSlider(lbl='Height',value='^height',width='200px',minimum=1,maximum=100)
        fb.numberTextBox(value='^height',places=2)
        fb.dataFormula('area','base * height', base='^base', height='^height')
        fb.numberTextBox(lbl='Area',value='^area',places=2,border='2px solid grey',padding='2px')

Note

dataFormula does not have to be necessarily a mathematical formula!

Table Of Contents

Previous topic

7.2.2. dataController

Next topic

7.2.4. dataRemote

This Page