I worked on to create A Multi-Usage To-Do Task System for Corporate Management. It helps in tracking the status of tasks and also as a reminder for pending tasks. While entering, user just has to select the name of the person to whom the task is assigned to and what the task is. Due Date is an Additional Option to prioritize the task. Task From Name is auto-fetched based on User Login with Wix-User Api. Also, have made good use of Created Time & Updated Time to track which task is pending/completed. Have also used JS Async/Await Function & dataset.refresh() to timely update task count as and when the user is interacting on the system.
Note that the same system can be used by User as a reminder of To-Do Tasks for themselves.
There are much more functions that I can add to this but the basic given one suffices my project needs.
You Can Watch The To-Do Management System Video On https://www.screencast.com/t/2YU7NTvK0hs
import wixData from 'wix-data';
import wixUsers from 'wix-users';
$w.onReady(function () {
updateItemsCount();
updateTotalCount();
});
export function repeater2_itemReady($item, itemData, index) {
$item('#text109').text = "Completed By " + itemData.taskfor ;
$item('#text111').text = "Completed On " + itemData._updatedDate;
}
async function updateItemsCount() {
let count = await wixData.query('todo')
.ne('task', true)
.count();
if (count === 1)
$w('#text112').text = 'Total 1 Task Left';
else
$w('#text112').text = `Total ${count} Tasks Left`;
$w('#text112').show();
}
export function checkbox1_change(event) {
updateItemsCount();
updateTotalCount();
}
export function dropdown3_change_1(event) {
$w("#dataset1").setFilter( wixData.filter()
.contains("taskfor", $w('#dropdown3').value)
.ne("task", true)
)
$w("#dataset3").setFilter( wixData.filter()
.contains("taskfor", $w('#dropdown3').value)
.eq("task", true)
)
updateItemsCount();
updateTotalCount();
}
async function updateTotalCount() {
let count = await wixData.query('todo')
.count();
$w('#text115').text = `Total ${count} To-Do Tasks Till Date`;
}
function textRemaining(){
var charsRemaining = $w("#textBox1").maxLength - $w("#textBox1").value.length;
$w("#text116").text = "Characters remaining: " + charsRemaining;
}
export function textBox1_keyPress(event) {
setTimeout(textRemaining,80);
$w("#text116").show();
}
export function repeater1_itemReady($item, itemData, index) {
$item('#text121').text = "Query Raised On " + itemData._createdDate ;
}
export function vectorImage2_click(event) {
$w('#text105').show('flip');
wixData.query("Members/PrivateMembersData")
.eq("_id", wixUsers.currentUser.id)
.find()
.then((results) => {
let a = results.items[0].firstName + " " + results.items[0].lastName;
let toSave = {
"duedate": $w('#datePicker1').value,
"taskfor":$w('#dropdown1').value,
"from": a,
"todo":$w('#textBox1').value,
};
wixData.save("todo", toSave)
.then( (result) => {
let item = result;
$w("#dataset1").refresh();
$w("#dataset3").refresh();
$w('#text105').hide('flip');
} )
.catch( (err) => {
let errorMsg = err;
} );
} );
updateItemsCount();
updateTotalCount();
}
if similar thing exists, then upvote it or add your own there.
https://www.myiclubonline.onl/