toggle button on browse screen
Posted: Thu Feb 18, 2016 1:02 pm
Hello,
I need a toggle-button on the browsescreen which alllows me to filter the records on the browse screen
I managed to make a jsscript for the button:
function nuLoadBrowse() {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10) {
dd='0'+dd;
}
if(mm<10) {
mm='0'+mm;
}
today = "'" + yyyy+'-'+mm+'-'+dd + "'";
jsdatum=today;
/* Append a new Action Button on Browse form */
var space = $( "#nuSpace" ).clone().removeAttr("id");
$( "#nuActionButtonHolder" ).append(space);
var elem = '<input id="execButton" type="button">';
$( "#nuActionButtonHolder" ).append(elem);
$( "#execButton" )
.addClass( "nuButton" )
.attr( "value", "Alles" )
.click(function() {
if (this.value == "Toekomst")
{
this.value = "Alles";
jsdatum=today;
}
else
{
this.value= "Toekomst";
jsdatum='2001-01-01';
}
}
);
}
The button works, but now I need to transger the value from the variable "jsdatum" to either the sql of the form or to the filter
I haven't got a clue how to transfer this, I think I will need a Hash-variabel, but I cant solve it.
And I do not jnow the proper syntax for this value. I tried to look it up with nudebug, but no success.
Furthermore I wonder if each change will cause an automatic requery.
Anyone know how to do this?
As you might notice I am a newbie, but I already love Nubuilder.
Thanks!
I need a toggle-button on the browsescreen which alllows me to filter the records on the browse screen
I managed to make a jsscript for the button:
function nuLoadBrowse() {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10) {
dd='0'+dd;
}
if(mm<10) {
mm='0'+mm;
}
today = "'" + yyyy+'-'+mm+'-'+dd + "'";
jsdatum=today;
/* Append a new Action Button on Browse form */
var space = $( "#nuSpace" ).clone().removeAttr("id");
$( "#nuActionButtonHolder" ).append(space);
var elem = '<input id="execButton" type="button">';
$( "#nuActionButtonHolder" ).append(elem);
$( "#execButton" )
.addClass( "nuButton" )
.attr( "value", "Alles" )
.click(function() {
if (this.value == "Toekomst")
{
this.value = "Alles";
jsdatum=today;
}
else
{
this.value= "Toekomst";
jsdatum='2001-01-01';
}
}
);
}
The button works, but now I need to transger the value from the variable "jsdatum" to either the sql of the form or to the filter
I haven't got a clue how to transfer this, I think I will need a Hash-variabel, but I cant solve it.
And I do not jnow the proper syntax for this value. I tried to look it up with nudebug, but no success.
Furthermore I wonder if each change will cause an automatic requery.
Anyone know how to do this?
As you might notice I am a newbie, but I already love Nubuilder.
Thanks!