Changing Grand Total Position
Question: In pivot tables, we would like to show column grand totals on top of the table and row grand totals at front. Please let us know how to alter positions. Asnwer: This script will move the grand total row to the top. widget.on('ready', function(sender, ev){ if ($(".p-grand-total-row-head", element).length > 0) { setTimeout(function(){ $('table#pivot_',element).prepend($('table#pivot_', element).find('tr:last')); $('div.table-container table', element).prepend($('div.table-container table', element).find('tr:last')); $('tbody',element).each(function(){ $(this).find('tr:first td').not('.phantom').css('border-bottom', '1px solid #ccc').find($('span, .p-value')).css('font-weight', 'bold'); }); $('.p-grand-total-row-head.p-first-data-col').css('border-left', 'none'); },500); } }); The below should work with Pivot 2.0. widget.on('ready', function(sender, ev){ //Define Variables var lastRowClass = $('tr.table-grid__row:contains(Grand Total)',element).last().attr('class') var firstClass = lastRowClass.split(' ')[0] var secondClass = lastRowClass.split(' ')[1] var firstRowClassBase = $('div.' + firstClass).first().attr('class').split(' ')[0] var firstRowClassNumber = $('div.' + firstClass).first().attr('class').split(' ')[1].match(/\d+/g) //If the first row class number does NOT equal zero... if(firstRowClassNumber[0] != 0){ $('div.' + firstRowClassBase + ' div.table-grid__cell').css({'border-top':'','font-weight':''}) $('tr.' + firstClass).first().insertAfter($('tr.table-grid__row-' + (firstRowClassNumber - 1))) $('div.' + firstClass).first().insertAfter($('div.table-grid__row-' + (firstRowClassNumber - 1))) } //Move Grand Total row to top $('div.' + secondClass).insertBefore($('div.' + firstClass).first()) $('tr.' + secondClass).insertBefore($('tr.' + firstClass).first()) $('div.' + secondClass + ' div.table-grid__cell').css({'border-bottom':'1px solid #ccc','border-top':'1px','font-weight':'bold'}) $('tr.' + secondClass + ' td').css({'border-bottom':'1px solid #ccc','border-top':'1px','font-weight':'bold'}) });1.6KViews0likes2CommentsHide Value From Tool-Tip
Question: I am looking for a way to hide the latitude/longitude from the tool-tip in a scatter map. It appears by default and I searched through other posts but couldn't find anything. I still want the tool tip to appear, just remove the lat/long. Answer: The lat/long are displayed because they are the marker's name - when a textual field is used (such as a country field) - that would be displayed in place of lat/long. There are two possible ways of achieving this: By clearing the value of the marker name By providing a custom HTML template without it In both cases, you would start with the widget event "beforedatapointtooltip" as described in the Sisense Javascript API Reference widget.on("beforedatapointtooltip", (event, params) => { // params contains: widget, context, template, cancel }); For approach #1 you can set the marker name to nothing: params.context.marker.name = ""; For approach #2 find the original template in the path: C:\Program Files\Sisense\PrismWeb\client\views\scattermap\scattermap-tooltip.html Then copy it into a plugin, edit to remove the HTML element referring to the "marker.name" property, and then change the "template" to point to your custom template: params.template = '<div data-ng-include="../plugins/myCustomTemplatePlugin/custom-scattermap-tooltip.html"></div>'; You could also simply paste the HTML itself as the "template" but that approach is less maintainable in the long run, so using a template file is preferable.947Views0likes0Comments