Utility Member update Page

I use a dropdown to select a member ( seems to be working fine )
when the filter is applied the only input item that is being updated is the title field that is being selected from the dataset.
All of the other fields are not being updated after the filter. The input items are all connected to the same dataset row that title is. I thought all of the other inputs should change with the filter being set.

import wixData from ‘wix-data’;
import wixLocation from “wix-location”;

//let DD1;

$w.onReady(function () {
//startup code

});

export function SelectMember_onclick() {
//Gather info from member selected and filter DS to that member only
$w(“#MembersDS”).onReady( () => {
$w(“#MembersDS”).setFilter( wixData.filter()
.contains(“title”, $w(“#SelectMember”).value)
);
$w(“#text4”).text = $w(“#SelectMember”).value ;
});
}

Hi,

A few points here:

You’re not really applying the filter, since you’re setting it in ‘$w(" #MembersDS ").onReady’, which runs when the dataset is ready (after the page is loaded).
So to draw a timeline:
page ready → dataset ready … → … → you’re dropdown changes → you set a function that will run when the dataset is ready (this already happened).

The reason that the title updates is you’re doing it yourself: ‘$w(" #text4 “).text = $w(” #SelectMember ").value’.

Try changing to:


export function SelectMember_onclick() {
	//Gather info from member selected and filter DS to that member only
	$w("#MembersDS").setFilter( wixData.filter()
 		.contains("title", $w("#SelectMember").value) 
 		);
}

Liran.

I appreciate your help with this and this is what I ended up with it seems to be working,
Thanks again
ray

//import wixUsers from ‘wix-users’;
import wixLocation from “wix-location”;
//import wixdata from “wix-data”;
import {session} from ‘wix-storage’;

$w.onReady( function () {

$w(“#input12”).hide();
$w(“#dataset1”).onReady( () => {
$w(“#dataset1”).new();
$w(“#dataset1”).onReady( () => {
$w(“#dataset1”).setFieldValue(“email”, session.getItem(“uemail”));
});
});
});

export function SaveReturn_onclick() {
$w(“#dataset1”).onReady( () => {
$w(“#dataset1”).save()
.then(()=> {
wixLocation.to(“/contact”); // back to NonMember Area
});
});
}

export function dataset1_error() {
//Add your code for this event here:
console.log(“New item created”);

}

export function input11_change() {
//Add your code for this event here:
$w(“#input12”).show();
$w.onReady( () => {
$w(“#dataset1”).onReady( () => {
$w(“#dataset1”).setFieldValue(“title”, $w(“#input11”).value + " " + $w(“#input2”).value + " " + $w(“#input3”).value);
});
});
}

export function input2_change() {
//Add your code for this event here:
$w(“#input12”).show();
$w.onReady( () => {
$w(“#dataset1”).onReady( () => {
$w(“#dataset1”).setFieldValue(“title”, $w(“#input11”).value + " " + $w(“#input2”).value + " " + $w(“#input3”).value);
});
});
}

export function input3_change() {
//Add your code for this event here:
$w(“#input12”).show();
$w.onReady( () => {
$w(“#dataset1”).onReady( () => {
$w(“#dataset1”).setFieldValue(“title”, $w(“#input11”).value + " " + $w(“#input2”).value + " " + $w(“#input3”).value);
});
});
}