我想做这样的事情:
<div class="show" >Element 1</div>
<div class="show" >Element 2</div>
<div class="show" >Element 3</div>
$("div.show").click(function () {
$current_show = $(this);
$("div.show").each(function () {
if ($(this) != $current_show ) //here i want to check current element is not same
{
$(this).text('Write something');
}
});
})
Run Code Online (Sandbox Code Playgroud)
或者还有另一种方法吗?
我正在做的是通过 2 个以上的页面传递数据。我在导航时将视图模型分配给下一页。在第二页中,我有一个在添加值后不刷新/更新的列表视图。
请帮帮我!!
这是我的代码
我的视图模型
public class MyViewModel : INotifyPropertyChanged
{
public string _userName { get; set; }
public List<family> familyList;
public List<family> FamilyList
{
get { return familyList; }
set
{
familyList = value;
OnPropertyChanged();
}
}
public event PropertyChangedEventHandler PropertyChanged;
public MyViewModel()
{
_userName = "Mak";
familyList = new List<family>();
}
public void AddMember(string memberName)
{
FamilyList.Add(new family
{
name = memberName,
id = Guid.NewGuid().ToString(),
username=_userName
});
}
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{ …Run Code Online (Sandbox Code Playgroud)