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.
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 ?
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) ?
Thank you
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
3 questions in 1 (default sort and calendar)
-
- Posts: 17
- Joined: Wed Aug 11, 2021 7:11 pm
3 questions in 1 (default sort and calendar)
You do not have the required permissions to view the files attached to this post.
-
- Posts: 156
- Joined: Wed Dec 23, 2020 12:28 pm
- Location: Russia, Volgograd
- Has thanked: 32 times
- Been thanked: 7 times
- Contact:
Re: 3 questions in 1 (default sort and calendar)
Have you PRIMARY AUTOINCREMENT KEY for Tasks table? Use It in Browse (forms property):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. 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
Code: Select all
select * from tasks
WHERE ....
ORDER BY youPrimaryKey
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 {
Wbr, miasoft.
-
- Posts: 156
- Joined: Wed Dec 23, 2020 12:28 pm
- Location: Russia, Volgograd
- Has thanked: 32 times
- Been thanked: 7 times
- Contact:
Re: 3 questions in 1 (default sort and calendar)
Insert in UserCode for you form: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 ?
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();
}
Wbr, miasoft.
-
- nuBuilder Team
- Posts: 4304
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: 3 questions in 1 (default sort and calendar)
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()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.
In the Browse SQL, add an
Code: Select all
ORDER BY created_at
Code: Select all
ORDER BY created_at DESC
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4304
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: 3 questions in 1 (default sort and calendar)
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!