I have set up the -tv.js page ok And built the first button using the help from the forums but I need to add 2 additional conditions and everything i tried has not worked.
here is where the button is appearing
and here is the code below. I was able to get the [custom][0] field in the detail view ok, I copied over the code to the -tv.js file but it didnt work.
I need a filter that looks at field 21 and picks this up from the logged in user, and another filter (field 33) that is Europe
any help would be appreciated.
Code: Select all
$j(function() {
var d = new Date();
// formatted date .. change order and separator to the ones you selected in your AppGini project
// in the below line, the format is month/day/year
//var formattedDate = (d.getDate()+7) + '/' + (d.getMonth()+1) + '/' + d.getFullYear();
var formattedDate = '01/04/2021'
// now build the 4 parts of the filter
var filter = {
'FilterAnd[1]': 'and',
'FilterField[1]': 14, // change this to the actual index of your date field
'FilterOperator[1]': 'less-than',
'FilterValue[1]': formattedDate
};
// building the filter url ... change tablename to the actual table name
var url = 'XXXXXXXXXXXXXXXXXXXXX_view.php?SortField=14&SortDirection=desc&' + $j.param(filter);
// finally, insert the filter button
$j('<a class="btn btn-lg btn-default" href="' + url + '">Due This Year</a>').appendTo('#top_buttons');
})