小编Sup*_*den的帖子

使用LINQ从ObservableCollection Source中删除元素

实际上,它更接近于:
ObservableCollections的RemoveAll?

可能重复:
使用LINQ删除List <T>中的对象

这是我正在使用的代码,但它不是很易读.我是否可以使用LINQ缩短下面的代码,同时仍具有相同的功能?

int index = 0;
int pos = 0;

foreach (var x in HomeViewModel.RecentPatients)
{
   if (x.PID == p.PID)
       pos = index;
   else
       index++;

}

HomeViewModel.RecentPatients.RemoveAt(pos); 
Run Code Online (Sandbox Code Playgroud)

c# linq foreach

6
推荐指数
1
解决办法
2万
查看次数

包含PHP文件的最佳做法是什么?

包含PHP文件的最佳做法是什么?

是否最好包含一个include.php包含所有项目PHP文件的文件?或者将它包含在那些需要它们的文件中

现在,我的项目在我的index.php文件中有几个包含文件.在index.php中包含我所有的php文件会降低效率吗?

最后,应该在哪里包含会话检查PHP文件?在所有PHP文件中?

php include

5
推荐指数
1
解决办法
1万
查看次数

删除表单的动作属性

如何在页面加载时删除表单的操作属性操作?

我的表格是

<form action="process" class="TTWForm ui-sortable-disabled" method="post"
      novalidate="">


           <div id="field2-container" class="field f_100 ui-resizable-disabled ui-state-disabled">
                <label for="field2">
                     Comments
                </label>
                <textarea rows="5" cols="20" name="field2" id="field2" required="required"></textarea>
           </div>


           <div id="field3-container" class="field f_100 radio-group required ui-resizable-disabled ui-state-disabled">

                <label for="field3-1">
                     Work
                </label>


                <div class="option clearfix">
                     <input name="field3" id="field3-1" value="Needs Revisions" type="radio">
                     <span class="option-title">
                          Needs Revisions
                     </span>
                </div>


                <div class="option clearfix">

                     <input name="field3" id="field3-2" value="Fine" type="radio">
                     <span class="option-title">
                          Fine
                     </span>
                </div>


                <div class="option clearfix">
                     <input name="field3" id="field3-3" value="Unstable" type="radio">
                     <span class="option-title">
                          Unstable
                     </span>

                </div>
           </div>


           <div …
Run Code Online (Sandbox Code Playgroud)

jquery

2
推荐指数
1
解决办法
1万
查看次数

使用fadeIn()附加html淡入淡出

我不能得到<li>附加到我的元素$('ul#posts')淡入.

我试过的事情.

  1. 在淡入之前设置display:noneof <li>.在请求之后无法查看附加的html.这意味着fadeIn()没有用.

  2. $(wall_post).appendTo('ul#posts').fadeIn("slow"); 似乎也没有用.

码:

var wall_post = '<li> <img src="image/avatar.jpg" class="avatar"><div class="status"><h2><a href="#" target="_blank">disran</a></h2><p class="message">' + textarea_content + '</p> ' + image_html + '<div class="data"><p class="name"><a href="' + siteurl + '" target="_blank">' + sitetitle + '</a></p><p class="caption">' + siteurl + '</p><p class="description">' + sitedesc + '</p></div></div> </div><p class="likes">5 hours ago · 100 Likes </p></li>';

var message_wall = $('#message_wall').attr('value');

$.ajax({
    type: "GET",
    url: "insert.php",
    data: "message_wall=" + wall_post,
    success: function () …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

0
推荐指数
1
解决办法
1692
查看次数

标签 统计

jquery ×2

c# ×1

foreach ×1

include ×1

javascript ×1

linq ×1

php ×1