You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attribute_table_column_filter.js plugin is a highly appreciated extension of LIZMAP. It makes filtering so much easier.
But there is one small issue: The plugin doesn't take over the width of the columns. It uses fixed width for every input element.
Here's an adapted version that takes column width into account:
lizMap.events.on({attributeLayerContentReady: function(e){varcleanLayerName=lizMap.cleanName(e.featureType);if($('#attribute-layer-table-'+cleanLayerName+'_wrapper').data('filtersON')===undefined){// Set flag to add filters only once$('#attribute-layer-table-'+cleanLayerName+'_wrapper').data('filtersON',true);$('#attribute-layer-table-'+cleanLayerName+'_wrapper thead:first th').not('.sorting_disabled').each(function(){vartitle=$(this).text();varwidth=$(this).width();$(this).html('<input type="text" placeholder=" '+title+'" style="width:'+(parseFloat(width)+20)+'px" />');});$('#attribute-layer-table-'+cleanLayerName).DataTable().columns().every(function(){varcolumn=this;$('input',this.header()).on('keyup change',function(){if(column.search()!==this.value){column.search(this.value).draw();}}).click(function(e){// We don't want to sort when users click on the search fielde.stopPropagation();});});lizMap.refreshDatatableSize("#attribute-layer-main-"+cleanLayerName);}}});
The text was updated successfully, but these errors were encountered:
The attribute_table_column_filter.js plugin is a highly appreciated extension of LIZMAP. It makes filtering so much easier.
But there is one small issue: The plugin doesn't take over the width of the columns. It uses fixed width for every input element.
Here's an adapted version that takes column width into account:
The text was updated successfully, but these errors were encountered: