new i18n function does not exists in jquery.datatables.js file... why?

new i18n function does not exists in jquery.datatables.js file... why?

yuricarvalhoyuricarvalho Posts: 7Questions: 0Answers: 0

Somebody knows why the file "jquery.dataTables.js" does not have the i18n function, and the file "jquery.dataTables.min.js" has ?

I have a problema because i'm using jquery.datatables.js file e the "buttons.colvis.js" does not recognize the function i18n ...

Please, somebody help me ?

Thanks!!!

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    The i18n method was introduced in v1.10.7. It sounds like you are using an old version of the software - 1.10.11 is the current release.

    Allan

  • yuricarvalhoyuricarvalho Posts: 7Questions: 0Answers: 0

    Hi allan, thanks for your reply.

    that's it!!! But now, i have another problem!! can you help me?
    I'm using:
    jquery-1.10.2.js
    jquery.dataTables.js - V. 1.10.11
    dataTables.fixedColumns.js - v 3.2.1

    And i'm trying to create a gridview with ScrollX:

    My Datatable script:

      $('.stripe').DataTable({
            //"dom": 'Bfrtip',
            "bSort": false,
            "paging":   false,
            "scrollX": true,
    
            buttons: ['colvis'],
            fixedColumns: {
                leftColumns: 2
            },
    
            "bScrollCollapse": true,       
            "paging": false,
            "bInfo": false,
            stateSave: false,
            "oLanguage": {
                "sSearch": "",
                "sZeroRecords": "",
                "sInfo": "_TOTAL_ registros encontrados.",
                "sEmptyTable": "",
                "sInfoFiltered": "(De um total de _MAX_ registros).",
                "oPaginate": {
                    "sPrevious": "<img width='13px' height='13px' alt='' src='/Proweb.net/relatorios/previous.png' />",
                    "sNext": "<img width='13px' height='13px' alt='' src='/Proweb.net/relatorios/next.png' />"
                }
            }
        });
    

    My ASPX script:

       <asp:Panel ID="panel_garantia" Width="1300px" runat="server" Visible="true">
     
           <div id="garantia">
     
               <br />
     
                <asp:Label ID="garantias" runat="server" Text="Escolha o Plano a Contratar"  Style="font-size: 10pt; color: #016838;"
                  CssClass="ControleWebCAP_Label"></asp:Label>
    
              <hr />
              <br />
               <div id="sub-garantias">
                      <span class="scroll left-scroll"> &#171; </span>
                       <span class="scroll right-scroll">&#187;</span>              
       <asp:GridView ID="gddPlanos" UseAccessibleHeader="true" ShowHeaderWhenEmpty="true" AutoGenerateColumns="true"  CssClass="resultadoGrid stripe" Width="22000px" runat="server">
                           <HeaderStyle CssClass="resultadoGridCabecalho" />
                           <PagerStyle BackColor="White" ForeColor="#000066"  HorizontalAlign="Left"
                            Font-Names="Verdana" Font-Size="7pt" />
                    <RowStyle CssClass="ControleWebCAP_DGRowStyle" />
                          <PagerStyle CssClass="ControleWebCAP_DGPagerStyle" />
                          <SelectedRowStyle CssClass="selected" />
                        <SortedAscendingCellStyle BackColor="#F1F1F1" />
                         <SortedAscendingHeaderStyle BackColor="#007DBB" />
                        <SortedDescendingCellStyle BackColor="#CAC9C9" />
                           <SortedDescendingHeaderStyle BackColor="#00547E" />
                      </asp:GridView>
     
                  <br />
             </div>
    
             </div>
       </asp:Panel>
    

    But when i display the page, my gridview does not render with 22000px, just 1300px....

    Can you help me?

    Image: http://s32.postimg.org/rf6jpamkj/render_gridview_incorrect.png

    But, when i remove the datatable script, the gridview render with 22000px width....

    Image: http://s32.postimg.org/jyr8wxuir/render_gridview_correct.png

    When i was using an older Datatable.js file, the script worked fine....

    Can you help me?

    (sorry for my bad english....)

    Thanks!

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Please post a link to a test page showing the issue.

    Thanks,
    Allan

  • yuricarvalhoyuricarvalho Posts: 7Questions: 0Answers: 0

    Thanks allan !!! :)

    The files: https://drive.google.com/open?id=0B06ZSGRQItkCVDRDUTB4S2tLX1k

    Mmy gridview has width="30000px" (very big!)

    But....
    The test page has only 1080px when i use the datatable script ?? :
    http://desenv.prowebseguros.com

    The first grid has the datatable script.

    The second hasn't.

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Its because, when DataTables creates the table it uses to determine column widths, it does so without assigning a static width to the table. You could try using autoWidth and setting it to false to stop it doing that, but really what I would recommend is simply:

    in the HTML for the table you have:

    style="width:30000px;border-collapse:collapse;">

    Can you change that to be:

    style="width:100%">
    

    You can't have border-collapse:collapse with a scrolling DataTable since it makes the column width calculations impossible I'm afraid.

    If you want padding around the cells, then just add padding rather than setting the table width to be huge.

    Allan

This discussion has been closed.