calender.png not found

calender.png not found

A.obj.sys.incA.obj.sys.inc Posts: 14Questions: 7Answers: 4

Using the example

https://editor.datatables.net/examples/simple/dates.html

I am getting calender.png not found. I found the reference to it in dataTables.editor.js line 7025. Anybody know where to find this file?

I am using Editor 1.5.1.

This question has accepted answers - jump to:

Answers

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

    Hi,

    That page should actually be redirecting now. I'll fix that shortly. The jQuery UI date picker example is now available here.

    Allan

  • A.obj.sys.incA.obj.sys.inc Posts: 14Questions: 7Answers: 4
    Answer ✓

    Hi Allan,
    Thank you for updating the link, but there was more that had to be done. I used the example to try and find calendar.png. It turns out that it is in Datatable-Editor-1.5.1/images. For some reason the example as presented in the link would not load the file. I forced the issue by explictly specifying where the file was. Notice "dateImage" in my test code.

    <!DOCTYPE html>
    <html>
    <head>
    
    <link rel="stylesheet" type="text/css" href="resources/css/jquery-ui.css"> 
    <link rel="stylesheet" type="text/css" href="resources/css/jquery.dataTables.min.css"> 
    <link rel="stylesheet" type="text/css" href="resources/css/buttons.dataTables.min.css">
    <link rel="stylesheet" type="text/css" href="resources/css/select.dataTables.min.css">  
    
    
    <script src="resources/js/jquery-1.11.3.min.js"></script>
    <script src="resources/js/jquery-ui.js"></script>
    <script src="resources/js/jquery.dataTables.min.js"></script>
    <script src="resources/js/dataTables.buttons.min.js"></script>
    <script src="resources/js/dataTables.select.min.js"></script>
    
    
    
    <link rel="stylesheet" type="text/css" href="resources/Datatable-Editor-1.5.1/css/editor.dataTables.css"> 
    
    <script type="text/javascript"
      src="resources/Datatable-Editor-1.5.1/js/dataTables.editor.js"></script>
      
      
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <script type="text/javascript">
    var editor; // use a global for the submit and return data rendering in the examples
    
    $(document).ready(function() {
        editor = new $.fn.dataTable.Editor( {
            ajax: 'data/do',
            table: '#example',
            fields: [ {
                    label: 'First name:',
                    name:  'first_name'
                }, {
                    label: 'Last name:',
                    name:  'last_name'
                }, {
                    label:      'Updated date:',
                    name:       'updated_date',
                    type:       'date',
                    def:        function () { return new Date(); },
                    dateFormat: $.datepicker.ISO_8601,
                    "dateImage" : "resources/Datatable-Editor-1.5.1/images/calender.png"
                }, {
                    label:      'Registered date:',
                    name:       'registered_date',
                    type:       'date',
                    def:        function () { return new Date(); },
                    dateFormat: $.datepicker.ISO_8601,
                    "dateImage" : "resources/Datatable-Editor-1.5.1/images/calender.png"
                }
            ]
        } );
     
        $('#example').DataTable( {
            dom: 'Bfrtip',
            ajax: 'data.json',
            columns: [
                { data: 'first_name' },
                { data: 'last_name' },
                { data: 'updated_date' },
                { data: 'registered_date' }
            ],
            select: true,
            buttons: [
                { extend: 'create', editor: editor },
                { extend: 'edit',   editor: editor },
                { extend: 'remove', editor: editor }
            ]
        } );
    } );
    
    </script>
    </head>
    <body>
    <table class="display" id="example">
            <thead>
                <tr>
                    <th>First name</th>
                    <th>Last name</th>
                    <th>Updated date</th>
                    <th>Registered date</th>
                </tr>
            </thead>
        </table>
    </body>
    </html>
    

    Please notice that all script and link references are local references. My application has to be self contained and cannot go to the internet to retrieve files. This poses an interesting problem, because you have to download everything you need.

    Anyway, when you comment out the "dateImage" line a failure is produced stating that
    http://localhost:9080/images/calender.png cannot be found.

    Hope this helps somebody. Please close the problem.
    Thanks.

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Thanks for posting back with your findings. I'll see what I can do to improve the packaging for that file.

    Allan

This discussion has been closed.