Christoph Zwerschke wrote:
Am 26.04.2013 18:10, schrieb Jose Soares:
if I use a controller returning a template as in:

         return dict(
             form = FindForm(),
             grid = SelectablePageDataGrid()
             grid_params=session.query(myMapper)
            )

then the accesses are to much.

This sounds like the SelectablePageDataGrid might make unnecessary checks for every row.

I don't know, because the accesses are the same even when there are no rows (when the grid is empty).
I also tried with the DataGrid, in this way: (but the result is the same)

@tg.expose(template="kid:templates.index")
def index(self):
       return dict(
           form = widgets.TableForm(),
           grid = widgets.DataGrid(),
           grid_params={}
           )

and this is the templates/index.kid:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> <html xmlns="http://www.w3.org/1999/xhtml"; xmlns:py="http://purl.org/kid/ns#";
   py:extends="'./master.kid'">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/> <link rel="stylesheet" type="text/css" href="/static/css/subModal.css" /> <script type="text/javascript" src="/static/javascript/subModal.js"></script> <script type="text/javascript" src="/static/javascript/dato_fiscale.js"></script> <script src="/tg_widgets/turbogears.widgets/ajax.js" type="text/javascript"></script> <script type="text/javascript" src="/tg_widgets/yui/yahoo-dom-event/yahoo-dom-event.js"></script> <script type="text/javascript" src="/tg_widgets/yui/connection/connection-min.js"></script> <script type="text/javascript" src="/tg_widgets/yui/element/element-min.js"></script> <script type="text/javascript" src="/tg_widgets/yui/button/button-min.js"></script> <script type="text/javascript" src="/tg_widgets/yui/dragdrop/dragdrop-min.js"></script> <script type="text/javascript" src="/tg_widgets/yui/container/container-min.js"></script>

   <script type="text/javascript">
   function callback_dettaglio(target, value)  {
      document.getElementById(target).innerHTML = value;
   }

   function hide_show_fieldset(target){
       if ($(target).style.display == 'none')
           $(target).style.display = ''
       else
           $(target).style.display = 'none'
   }
   </script>

</head>

<body>

   <span py:if="defined('no_history')">
       <script type="text/javascript">
           if(history.length>0)history.forward()
       </script>

   </span>
   <div>

   <div id="container_form" py:if="defined('container_form')">
       <div class="bd">
         <span py:if="defined('container_form_params')">
<span py:replace="container_form.display(**container_form_params)"/>
         </span>
       </div>
   </div>

   <span py:if="defined('form_params')">
       <span py:replace="form(**form_params)"/>
   </span>

   <span py:if="defined('grid')">
       <span py:replace="grid(grid_params)"/>
   </span>

   <span py:if="defined('datagrid')">
       <div py:replace="datagrid()" />
   </span>
 </div>
</body>
</html>

ps:

by the way, I'm migrating from tg 1.1.3 to tg2 but for meanwhile , I need to have this version working.


--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to