DataList object

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
ksabra
Posts: 8
Joined: 2020-05-26 11:58

DataList object

Post by ksabra » 2020-11-07 22:25

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

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: DataList object

Post by jsetzer » 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();
});
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

ksabra
Posts: 8
Joined: 2020-05-26 11:58

Re: DataList object

Post by ksabra » 2020-11-10 18:13

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
		}
	}		

Post Reply