Page 1 of 1
3 questions in 1 (default sort and calendar)
Posted: Mon Sep 20, 2021 9:01 pm
by Mike1961
1) I want to display all the tasks from my team in the same order that were created, by default.
I noticed that the list is not growing that way.
default sort for the same date.jpg
How can I obtain this ? Should I add a (hidden) field, with the creation time or is it an easier way ?
In my case, the tasks were created by
Michel/Michel/Michel/Luc/Michel/Simon
2) when somebody creates a task, I have a calendar to choose the date. This should be the date of the day, but also another one, if needed. is it a way to prepopulate this calendar with the date of the day ?
date of the day.jpg
3) about this calendar, this is my own problem (colorblind), the date of the day is not very visible (red ?). Should I change the code to choose another color (bigger bold blue by example) ?
today.jpg
Thank you
Re: 3 questions in 1 (default sort and calendar)
Posted: Tue Sep 21, 2021 4:49 am
by miasoft
Mike1961 wrote:1) I want to display all the tasks from my team in the same order that were created, by default.
I noticed that the list is not growing that way.
default sort for the same date.jpg
How can I obtain this ? Should I add a (hidden) field, with the creation time or is it an easier way ?
In my case, the tasks were created by
Michel/Michel/Michel/Luc/Michel/Simon
u
Have you PRIMARY AUTOINCREMENT KEY for Tasks table? Use It in Browse (forms property):
Code: Select all
select * from tasks
WHERE ....
ORDER BY youPrimaryKey
About calendar- try to play with CSS in .\core\css\nubuider4.css
Code: Select all
.nuCalendar {
position:absolute;
width:210px;
height:213px;
color:#000000;
border-style:none;
user-select: none
}
#nuCalendar {
box-shadow:5px 5px 5px 0 rgba(150,147,150,1)
}
#nulink {
position:absolute;
right:55px;
padding:5px;
color:#dfdfdf
}
.nuCalendarColor {
background-color:#BADEEB
}
.nuCalendarSelected:hover {
Re: 3 questions in 1 (default sort and calendar)
Posted: Tue Sep 21, 2021 5:06 am
by miasoft
Mike1961 wrote:ere created by Michel/Michel/Michel/Luc/Michel/Simon
2) when somebody creates a task, I have a calendar to choose the date. This should be the date of the day, but also another one, if needed. is it a way to prepopulate this calendar with the date of the day ?
Insert in UserCode for you form:
Code: Select all
function getCurrentDate() {
var d = new Date();
// var df = nuPad2(d.getDate()) + '-' + nuPad2(d.getMonth() + 1) + '-' + d.getFullYear();
var df = d.getFullYear() +'-' + nuPad2(d.getMonth() + 1)+ '-'+ nuPad2(d.getDate()) ;
return df;
}
function nuBeforeSave() {
if (nuFORM.edited === true) {
var d = getCurrentDate();
$('#DATECHANGE').val(d).change(); //you must have field DATECHANGE in table
}
}
if(nuIsNewRecord()){
var d = getCurrentDate();
$('#YouDATE').val(d).change();
}
Re: 3 questions in 1 (default sort and calendar)
Posted: Tue Sep 21, 2021 8:10 am
by kev1n
Mike1961 wrote:1) I want to display all the tasks from my team in the same order that were created, by default.
I noticed that the list is not growing that way.
If you're not using an auto increment primary key, add a new column to your table of type timestamp and with a default value current_timestamp()
timestamp.jpg
In the Browse SQL, add an
Or with descending order to show the latest records on top of the list:
Re: 3 questions in 1 (default sort and calendar)
Posted: Tue Sep 21, 2021 8:13 am
by kev1n
Mike1961 wrote:
when somebody creates a task, I have a calendar to choose the date. This should be the date of the day, but also another one, if needed. is it a way to prepopulate this calendar with the date of the day ?
Code: Select all
if(nuIsNewRecord()){
nuSetDateValue('Replace_with_your_date_object_id');
}
PS: Please, one question, one topic. It will be easier for us to answer them and for others to find answers in the future. Thanks!