Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% extends 'layout_1_column' %}
- {% block main %}
- <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/dt-1.10.16/datatables.min.css"/>
- <script type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.10.16/datatables.min.js"></script>
- {% include 'entity_list' key:page.adx_entitylist.id %}
- {% fetchxml my_query %}
- <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
- <entity name="new_inquiry">
- <attribute name="new_name" />
- <attribute name="statuscode" />
- <attribute name="new_response" />
- <attribute name="new_question" />
- <attribute name="new_inquiryid" />
- <order attribute="new_name" descending="false" />
- <filter type="and">
- <condition attribute="statecode" operator="eq" value="0" />
- </filter>
- </entity>
- </fetch>
- {% endfetchxml %}
- <div name="content" style="padding: 15px 30px 0 0; clear: both;">
- <table id="example" class="display table table-striped table-bordered" style="width:100%">
- <thead>
- <tr>
- <th>Id</th>
- <th>Status Code</th>
- <th>Question</th>
- <th>Response</th>
- </tr>
- </thead>
- <tbody>
- {% for result in my_query.results.entities %}
- <tr style="cursor: pointer;">
- <td>{{ result.new_inquiryid }}</th>
- <td>{{ result.new_name | escape }}</td>
- <td>{{ result.new_question }}</td>
- <td>{{ result.new_response }}</td>
- </tr>
- {% endfor %}
- </tbody>
- <tfoot>
- <tr>
- <td>Id</th>
- <th>Name</th>
- <th>Question</th>
- <th>Response</th>
- </tr>
- </tfoot>
- </table>
- <div class="clear"></div>
- </div>
- </div>
- </div>
- <script>
- $(document).ready(function() {
- var table = $('#example').DataTable( {
- //"pageLength": 2,
- "columnDefs": [
- {
- "targets": [ 0 ],
- "visible": false,
- "searchable": false
- }
- ]
- });
- $('#example tbody').on( 'click', 'tr', function () {
- var id = table.row( this ).data()[0];
- console.log( 'Clicked row id '+id );
- window.location.href = "/inquiries/inquiry-create/?id="+id;
- } );
- $('#button').click( function () {
- table.row('.selected').remove().draw( false );
- } );
- } );
- </script>
- {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement