@@ -1544,8 +1544,13 @@ var lizAttributeTable = function() {
15441544 myDom = '<<t>ipl>' ;
15451545 }
15461546
1547+ const datatablesUrl = globalThis [ 'lizUrls' ] . wms . replace ( 'service' , 'datatables' ) ;
1548+ const params = globalThis [ 'lizUrls' ] . params ;
1549+ params [ 'layerId' ] = lConfig . id ;
1550+
15471551 $ ( aTable ) . dataTable ( {
1548- data : dataSet
1552+ serverSide : true
1553+ , ajax : datatablesUrl + '?' + new URLSearchParams ( params ) . toString ( )
15491554 , columns : columns
15501555 , initComplete : function ( settings , json ) {
15511556 const api = new $ . fn . dataTable . Api ( settings ) ;
@@ -1562,13 +1567,13 @@ var lizAttributeTable = function() {
15621567 , order : [ [ firstDisplayedColIndex , "asc" ] ]
15631568 , language : { url :globalThis [ 'lizUrls' ] [ "dataTableLanguage" ] }
15641569 , deferRender : true
1565- , createdRow : function ( row , data , dataIndex ) {
1566- if ( $ . inArray ( data . DT_RowId . toString ( ) , lConfig [ 'selectedFeatures' ] ) != - 1
1567- ) {
1568- $ ( row ) . addClass ( 'selected' ) ;
1569- data . lizSelected = 'a' ;
1570- }
1571- }
1570+ // ,createdRow: function ( row, data, dataIndex ) {
1571+ // if ( $.inArray( data.DT_RowId.toString(), lConfig['selectedFeatures'] ) != -1
1572+ // ) {
1573+ // $(row).addClass('selected');
1574+ // data.lizSelected = 'a';
1575+ // }
1576+ // }
15721577 , drawCallback : function ( settings ) {
15731578 // rendering ok, find img with data-attr-thumbnail
15741579 const thumbnailColl = document . getElementsByClassName ( 'data-attr-thumbnail' ) ;
@@ -1577,7 +1582,7 @@ var lizAttributeTable = function() {
15771582 }
15781583 }
15791584 , dom : myDom
1580- , pageLength : 50
1585+ , pageLength : 10
15811586 , scrollY : '95%'
15821587 , scrollX : '100%'
15831588
@@ -1661,11 +1666,11 @@ var lizAttributeTable = function() {
16611666 const columns = [ ] ;
16621667 let firstDisplayedColIndex = 0 ;
16631668 // Column with selected status
1664- columns . push ( { "data" : "lizSelected" , "width" : "25px" , "searchable" : false , "sortable" : true , "visible" : false } ) ;
1665- firstDisplayedColIndex += 1 ;
1669+ // columns.push( {"data": "lizSelected", "width": "25px", "searchable": false, "sortable": true, "visible": false} );
1670+ // firstDisplayedColIndex+=1;
16661671
1667- columns . push ( { "data" : "featureToolbar" , "width" : "25px" , "searchable" : false , "sortable" : false } ) ;
1668- firstDisplayedColIndex += 1 ;
1672+ // columns.push({ "data": "featureToolbar", "width": "25px", "searchable": false, "sortable": false});
1673+ // firstDisplayedColIndex += 1;
16691674
16701675 // Add column for each field
16711676 for ( var columnName in atFeatures [ 0 ] . properties ) {
@@ -1897,11 +1902,11 @@ var lizAttributeTable = function() {
18971902
18981903 // Add row ID
18991904 line [ 'DT_RowId' ] = fid ;
1900- line [ 'lizSelected' ] = 'z' ;
1905+ // line['lizSelected'] = 'z';
19011906
1902- if ( selectedFeatures && $ . inArray ( fid , selectedFeatures ) != - 1 )
1903- line . lizSelected = 'a' ;
1904- line [ 'featureToolbar' ] = `<lizmap-feature-toolbar value="${ layerId + '.' + fid } " ${ isChild ? `parent-layer-id="${ parentLayerID } "` : '' } ${ pivotId ? `pivot-layer="${ pivotId } "` : '' } ></lizmap-feature-toolbar>` ;
1907+ // if( selectedFeatures && $.inArray( fid, selectedFeatures ) != -1 )
1908+ // line.lizSelected = 'a';
1909+ // line['featureToolbar'] = `<lizmap-feature-toolbar value="${layerId + '.' + fid}" ${isChild ? `parent-layer-id="${parentLayerID}"`: ''} ${pivotId ? `pivot-layer="${pivotId}"`: ''}></lizmap-feature-toolbar>`;
19051910
19061911 // Build table lines
19071912 for ( var idx in feat . properties ) {
0 commit comments