layout.html

39 views
Skip to first unread message

Hugo Marques

unread,
May 27, 2015, 4:25:40 PM5/27/15
to web2py-us...@googlegroups.com
Utilizando o {{extend 'layout.html'}} a view fica com uma opção de limite de registros que são mostrados na tela, como retiro essa opção para visualizar todos de uma só vez?

sdf.png

Glauco Junior

unread,
May 27, 2015, 4:34:49 PM5/27/15
to web2py-us...@googlegroups.com
Hugo,

Se a opção só aparece ao utilizar o {{extend 'layout.html'}} pode ser que esse controle esteja sendo criado no arquivo 'layout.html', para remover essa opção basta retirar o trecho de código correspondente direto do arquivo.

Agora como está sendo feita essa limitação dos registros? Precisamos do código do controller para entender melhor.

Abraço!

Em 27 de maio de 2015 17:25, Hugo Marques <marque...@gmail.com> escreveu:
Utilizando o {{extend 'layout.html'}} a view fica com uma opção de limite de registros que são mostrados na tela, como retiro essa opção para visualizar todos de uma só vez?

--
Você recebeu essa mensagem por estar inscrito no grupo web2py-users-brazil.
Para enviar uma mensagem ao grupo, envie email a: web2py-us...@googlegroups.com
Para se desinscrever, envie email a: web2py-users-br...@googlegroups.com
Para mais opções, visite o site do grupo em: http://groups.google.com/group/web2py-users-brazil?hl=en
---
Você recebeu essa mensagem porque está inscrito no grupo "web2py-users-brazil" dos Grupos do Google.
Para cancelar inscrição nesse grupo e parar de receber e-mails dele, envie um e-mail para web2py-users-br...@googlegroups.com.
Para mais opções, acesse https://groups.google.com/d/optout.

Glauco Junior

unread,
May 27, 2015, 4:36:09 PM5/27/15
to web2py-us...@googlegroups.com
Hugo, 

Só lembrando que se você remover o trecho de código direto do arquivo layout.html as demais views que extenderem esse arquivo também ficarão sem o controle.

Abraço!

Ari Sobel

unread,
May 27, 2015, 4:45:32 PM5/27/15
to web2py googlegroups
A questão é se o Hugo está utilizando  Grid (SQLFORM.grid).
Mas ta com cara de estar usando algum plugin baseado no "datatables".

Cada uma desas opções teria um método se nao me engano de controlar o "LIMIT" de exibição de registros.

Nao creio que seja algo ligado ao 'layout.html'

sds

Hugo Marques

unread,
May 27, 2015, 8:32:03 PM5/27/15
to web2py-us...@googlegroups.com
Minha view esta assim:

{{extend 'layout.html'}}
<a onclick="$('.alert').hide()" style="text-decoration: none; cursor: pointer">
    <div class="alert alert-danger alert-dismissible" role="alert" hidden="" id="erro" style="display: none;">
        <strong>Atenção! </strong><span id="erro_mesage"></span>
    </div>
</a>
{{if info:}}
<div class="alert alert-success alert-dismissible" role="alert">
    <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span>
    </button>
    <strong>{{=info}}</strong>
</div>
{{pass}}
<form id="form_add_projeto" method="post" enctype="multipart/form-data" action="">
    <table style="width: 400px;">
        <tbody>

        <tr>
            <td><label for="proj_nome">*Nome: </label></td>
            <td><input class="string" id="proj_nome" maxlength="128" placeholder="Nome do projeto" type="text" value="{{=projeto.proj_nome if 'projeto' in globals() else ''}}"></td>

            <td><label for="proj_descricao">Descrição: </label></td>
            <td><input class="string" id="proj_descricao" maxlength="128" placeholder="Caracteristicas do projeto" type="text" value="{{=projeto.proj_descricao if 'projeto' in globals() else ''}}"></td>
        </tr>

        <tr>
            <td><label for="proj_versao">Versão: </label></td>
            <td><input class="string" id="proj_versao" maxlength="10" placeholder="Versão do projeto" type="text" value="{{=projeto.proj_versao if 'projeto' in globals() else ''}}"></td>

            <td><label for="proj_data">Data: </label></td>
            <td><input class="integer" id="proj_data" maxlength="20" placeholder="Data de inicio" type="date" value="{{=projeto.proj_data if 'projeto' in globals() else ''}}"></td>
        </tr>

        <tr>
            <td><label for="proj_anexo">Anexo PDF: </label></td>
            <input name="_formname" type="hidden" value="projeto_form">
            <td><input class="upload" name="projeto_file" type="file" ip="proj_anexo"></td>

            <td></td>
            <td></td>
        </tr>
        <tr>
            <td colspan="4">
                <div style="width: 100%; text-align: center"><br>
                    <label class="text-center" style="text-decoration: underline;font-size: 12pt;"> Componentes </label><br><br>
                </div>
                <div style="margin-left: 150px; text-align: center" >
                    <label style="margin: -20px 60px;">Disponíveis:</label>{{=auth.wiki('_search')}} <!--<input type="search" class="" placeholder="" aria-controls="table_projeto">-->
                    <label style="margin-left: 370px;">Incluidos:</label>

                <div style="display: flex;width:500px; text-align: center; "  >
                    <select id="comp_select" multiple class="form-control" size="10" style="width:300px; ">
                             {{for comp in componente:}}
                                {{if 'v_comp' in globals() and comp.id not in v_comp:}}
                                <option value="{{=comp.id}} " >{{=comp.comp_nome}}</option>
                                {{pass}}
                                {{if not 'v_comp' in globals():}}
                                <option value="{{=comp.id}}" >{{=comp.comp_nome}}</option>
                                {{pass}}
                             {{pass}}
                    </select>
                    <div style="display: inline; text-align: center;">
                        <input type="button" onclick="sel1();" value="<<" class="btn btn-sm" style="margin: 0px 0px 0px 0px;">
                        <input type="button" onclick="sel2();" value="<" class="btn btn-sm" style="margin: 0px 0px 0px 0px;">
                        <input type="button" onclick="sel3();" value=">" class="btn btn-sm" style="margin: 0px 0px 0px 0px;">
                        <input type="button" onclick="sel4();" value=">>" class="btn btn-sm" style="margin: 0px 0px 0px 0px;">
                        <input type="button" onclick="quantAlterar();" value="Quant" class="btn btn-sm" style="margin: 5px 0px 5px 0px;">{{pass}}
                    </div >
                    <select id="comp_select_usu" multiple class="form-control" size="10" style="width:300px;">
                            {{for comp in componente:}}
                                {{if 'v_comp' in globals() and comp.id in v_comp:}}
                                    <option value="{{=comp.id}}" >{{=v_quant[str(comp.id)]}}</option>
                                {{pass}}
                            {{pass}}
                    </select>
                </div>
            </div>
        </tr>

        <tr >
            <td colspan="4" style="text-align: center;"><input type="submit" value="{{=botao}}" Class="btn" >
            {{if botao!="Cadastrar":}}<a class="btn btn-default" href="{{=URL('projeto')}}" role="button" style="margin-right: auto">Cancelar</a>{{pass}}</td>
        </tr>
        </tbody>
    </table>

    <input type="hidden" id="projeto_id" value="{{=projeto.id if 'projeto' in globals() else ''}}">
    <input type="hidden" id="nome_proj" value="{{=projeto.proj_nome if 'projeto' in globals() else ''}}">
    <input type="hidden" id="select_comp" value="{{=selecao if 'selecao' in globals() else ''}}">

</form>
<hr>

    <table class="table table-striped table-bordered table-hover" id="table_projeto" >
        <thead>
        <tr>
            <th>Nome</th>
            <th>Descrição</th>
            <th>Versão</th>
            <th>Data</th>
            <th>Anexo PDF.</th>
            <th>Componentes</th>

            <th style="width: 250px;"></th>
        </tr>
        </thead>
        <tbody>

        {{for i in dados:}}
        <tr class="odd gradeA">
            <td>{{=i.proj_nome}}</td>
            <td>{{=i.proj_descricao}}</td>
            <td>{{=i.proj_versao }}</td>
            <td>{{=i.proj_data if i.proj_data != None else ''}}</td>
            <td><a href="{{=URL(f='link', args=i.proj_anexo)}}"> link </a></td>

            <td>{{if len(db(db.projcomp.proj_id==i.id).select()) != 0:}}<a href="{{=URL('listaComponentes',args=[str(i.id)])}}" >Lista</a>{{pass}}</td>
            <td style="text-align: center"><a href="{{=URL('projeto',args=[i.id,'projeto'])}}"><button type="button" class="btn btn-default btn-md" style="margin-right: 10px;">Alterar</button></a>
                <button type="button" id="{{=i.id}}" onclick="aviso(this);" class="btn btn-primary" style="margin-right: 10px;" >Deletar</button>
                <a href="{{=URL('produzido',args=[i.id,'projeto'])}}"><button type="button" class="btn btn-default btn-md" style="margin-right: 10px;">Produzir</button></a>

        </tr>
        {{pass}}
        </tbody>
        <tfoot>

        </tfoot>
    </table> 

Matheus Suffi

unread,
May 28, 2015, 7:16:01 AM5/28/15
to web2py-us...@googlegroups.com
cara isso é datatables, verifique esse id 'table_projeto' que vc setou na sua table se não é ele que transforma a table em 'datatables' ou verifique se não existe um .js externo que esta fazendo isso para todas as tables 

ja que vc falou que isso acontece só quando carrega o layout, vc apenas teria que olhar nos scripts js que vc carrega que não estão relacionados a 'bootstrap' ou algo do tipo
Reply all
Reply to author
Forward
0 new messages