Smartgrid component in web2py is very powerful. I wonder if it is possible to add any additional markup into the View/Edit pages of the smartgrid.
Normall, in web2py we need to create a view html file corresponding to a function in the controller. The problem with smartgrid is that the controller functions are automatically defined by the component.
For example, clicking the View button in a smartgrid goes to the following url:
default/index/dataset/view/dataset/1
Now, my question is if I can create a custom view html file for this page that can contain things other than smartgrid?
The smartgrid component is not automatically defining controller functions. Rather, the links for view, edit, etc. are simply passing additional arguments to the same function where the smartgrid is defined (e.g., in the above URL,
dataset/view/dataset/1are all arguments to theindexfunction, which presumably is where your smartgrid is defined).You have at least two options. First, you could add conditional logic to the
index.htmlview, such as:Alternatively, you could specify a different view from within the controller function, such as: