Page 1 of 1

DataList object

Posted: 2020-11-07 22:25
by ksabra
So I think if there is a property to disable sum from a column in the table by a DataList object
Without regenerating files from appgini it would be perfect
Some groups should not see the sum column

Re: DataList object

Posted: 2020-11-08 04:44
by jsetzer

Code: Select all

// file: hooks/TABLENAME-tv.js
jQuery(function () {
    var show_sum = false; // <-- your condition here
    if (!show_sum) jQuery(".table_view > div.table-responsive > table > tbody > tr.success").not("[data-id]").hide();
});

Re: DataList object

Posted: 2020-11-10 18:13
by ksabra
jsetzer wrote:
2020-11-08 04:44

Code: Select all

// file: hooks/TABLENAME-tv.js
jQuery(function () {
    var show_sum = false; // <-- your condition here
    if (!show_sum) jQuery(".table_view > div.table-responsive > table > tbody > tr.success").not("[data-id]").hide();
});
jsetzer Thank you so much

It worked as follows
// file: hooks/footer-extras.php

Code: Select all

	$script_name = basename($_SERVER['PHP_SELF']);
	if($script_name == 'TABLENAME_view.php' ){
		$mi = getMemberInfo();
		// hide  SUM only if the user belongs to this group
		if(in_array($mi['group'], ['Group1', 'Group2', 'Group3', 'Group4'])) {
			?>
			<script>
			$j(function() {
			   $j(".table_view > div.table-responsive > table > tbody > tr.success").not("[data-id]").hide();
			})
			</script>
			<?php
		}
	}