We recommend reviewing what is submitted before posting, in case your idea has already been submitted by another community member. If it has been submitted, vote for that existing feature request (by clicking the up arrow) to increase its opportunity of being added to Cireson solutions.
For more information around feature requests in the Cireson Community click here.
Change standard values for filters (like @createdfilter)
Dear all,
I've an issue with big sql table dashboard data in cireson.
I'm using the @createdfilter filter.
It would be great to set the standard value to e.g. "This Month" instead of loading everything everytime when using the report.
Thank you for your votes!
BR, Peter
Comments
Hi Peter,
I have come up with a little bit of a hack for this in the meantime for you so put this into customspace/custom.js or script load it in from a separate file. Let me know if this works, it should apply the default to SQL grid widgets and SQL chart widgets!
$(document).ready(function(){
setTimeout(function(){
var charts = $('.chart-resize-wrapper');
charts.each(function(){
if($(this).data().$scope.vm.dateSelected != undefined){
$(this).data().$scope.vm.selectDateOption("Yesterday");
$(this).data().$scope.$digest();
}
});
var grid = $('[class="clearfix ng-scope"]');
grid.each(function(){
if($(this).data().$scope.vm.dateSelected != undefined){
$(this).data().$scope.vm.selectDateOption("Yesterday");
$(this).data().$scope.$digest();
}
});
}, 5000);
});
Thanks,
Shane
Thank you shane, is working great!!! ;)
with a window.location.href, I should be able to filter for specific dashboard pages
Yep exactly, that will do all of them on every dashboard page but by all means target away! This is the more complicate bit of the code handled :-)
one thing I've to test is, how the timeout 5000 is working
if everything is loaded and the it gets filtered, or the load process gets interrupted / restarted
additional example
$(this).data().$scope.vm.selectDateOption("ThisMonth");
Just for ease, here is a list of possible strings you can use:
"NoFilter", "Yesterday", "ThisWeek", "ThisMonth", "ThisQuarter", "LastQuarter", "YTD", "LastYear"