Find A Law Firm
Instructions
- Use the search box to filter the results based on firm name, location, email or telephone.
- Click on the field title to sort the results.
- Click on the ‘+’ sign to view hidden information.
- Click on any firm name to view more information (opens in a new page).
Firm Email: ‘ + d.email ; } function loadData(rows) { var dt = $(‘#find_firm’).DataTable({ “destroy”: true, “pageLength”: 50, “data”: rows, “columns”: [ { “class”: “details-control”, “orderable”: false, “data”: null, “defaultContent”: ” }, { “data”: ‘name’, “searchable”: true, “orderable” : false, “className”: “text-left”, “render”: function (data, type, row) { // console.log(‘row’, row) if (row[“firm”] === ”) { return ‘No Data’; }else { let name = `${row[‘name’]}`; return name } }}, { “data”: ‘tel’ }, { “data”: ‘city’ } ], “order”: [[1, ‘asc’]] } ); } $(window).load(function() { fetch(‘https://sls2.sabahlawsociety.org/api/sls/lawfirms’,{ headers: { ‘Content-Type’: ‘application/json’, }}) .then(response => { if(!response.ok){ throw Error(‘Error in fetching data.’) } return response.json() }).then(response => { loadData(response) }) var detailRows = []; $(‘#find_firm tbody’).on( ‘click’, ‘tr td.details-control’, function () { var tr = $(this).closest(‘tr’); var row = dt.row( tr ); var idx = $.inArray( tr.attr(‘id’), detailRows ); if ( row.child.isShown() ) { tr.removeClass( ‘details’ ); row.child.hide(); detailRows.splice( idx, 1 ); } else { tr.addClass( ‘details’ ); row.child( format( row.data() ) ).show(); if ( idx === -1 ) { detailRows.push( tr.attr(‘id’) ); } } }); }); ]]]]]]>]]]]>]]>
Copyright © 2018 Sabah Law Society