小编use*_*935的帖子

jquery删除表行

我有一张桌子

<table id="favoriteFoodTable">
    <th>
        Food Name:
    </th>
    <th>
        Restaurant Name:
    </th>
    <th>

    </th>
    <?php while ($row = $foods->fetch()) {
        ?>
        <tr>
            <td>
                <?php echo $row['foodName']; ?>
            </td>
            <td>
                <?php echo $row['restaurantName']; ?>
            </td>
            <td>
                <a class="deleteLink" href="" >delete</a>
            </td>
        </tr>
    <?php } ?>
</table>
Run Code Online (Sandbox Code Playgroud)

我使用这个jquery函数,所以当用户点击删除时,行的背景将会改变,然后行将被删除

$(document).ready(function() {
    $("#favoriteFoodTable .deleteLink").on("click",function() {
        var td = $(this).parent();
        var tr = td.parent();
        //change the background color to red before removing
        tr.css("background-color","#FF3700");

        tr.fadeOut(400, function(){
            tr.remove();
        });
    });
});
Run Code Online (Sandbox Code Playgroud)

只是背景正在改变,但行没有删除,为什么?怎么解决?

jquery

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

如何删除警告可序列化类ClASSNAME不声明long类型的静态最终serialVersionUID字段

我创建了一个扩展Exception类的类,我在Eclipse上得到了这个警告

可序列化类PhoneAlreadyExists不声明long类型的静态最终serialVersionUID字段

如何删除它?

public class PhoneAlreadyExists extends Exception {
    public PhoneAlreadyExists() {
        // TODO Auto-generated constructor stub
        super();
    }

    PhoneAlreadyExists(String message) {
        super(message);
    }

}
Run Code Online (Sandbox Code Playgroud)

java

17
推荐指数
3
解决办法
3万
查看次数

android:相对布局两个按钮占用所有可用的水平空间

我有一个相对布局,我有两个按钮,分别带有文本"hello"和"world".我希望这两个按钮彼此相邻,同样占据整个水平空间.

我尝试了以下但没有得到预期的输出

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent">

     <Button android:layout_height="wrap_content" android:layout_width="wrap_content"      android:text="@string/world" android:id="@+id/world"
     android:layout_alignParentRight="true"
     android:layout_toRightOf="@+id/hello"
     android:layout_alignTop="@+id/hello"
  />  


       <Button
          android:id="@+id/hello"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/hello"
          android:layout_alignParentLeft="true"
          android:layout_alignParentBottom="true"
        />
   </RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

我尝试将两个孩子的android:layout_width更改为fill_parent,但这也没有用.

我有一个使用LinearLayout和layout_weight设置为0.5的两个孩子的工作解决方案,但我想了解是否有相关布局本身的方法.

谢谢,

android android-layout

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

android如何在适配器内调用startActivityForResult

我有一个适配器类:

public class AdapterAllAddress extends BaseExpandableListAdapter {
private Context context;
    public AdapterAllAddress(Context context,
            ArrayList<AllAddressesGroup> groups) {
        // TODO Auto-generated constructor stub
        this.context = context;
    }
}
Run Code Online (Sandbox Code Playgroud)

我想在startActivityForResult点击按钮时打电话,我知道我可以这样打电话startActivity:

context.startActivity() 
Run Code Online (Sandbox Code Playgroud)

但我正在寻找有结果的活动,请问怎么样?

java android android-adapter android-activity android-adapterview

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

Android使用支持库来支持SearchView

这是我的代码:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    MenuItem searchItem = menu.findItem(R.id.searchMenuItem);
    SearchManager searchManager =
        (SearchManager) getSystemService(Context.SEARCH_SERVICE);
    SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
    // searchView.set
    searchView.setSearchableInfo(
        searchManager.getSearchableInfo(getComponentName()));
    searchView.setIconifiedByDefault(false);
}
Run Code Online (Sandbox Code Playgroud)

我的最小API是8.
我有这个编译错误

Call requires API level 11 (current min is 8):
    android.widget.SearchView#setSearchableInfo
Run Code Online (Sandbox Code Playgroud)

注意,我无法更改最低SDK.

android android-actionbar android-support-library android-search

8
推荐指数
1
解决办法
4489
查看次数

android启动短信意图,没有任何收件人

我想从我的应用程序中打开Android SMS应用程序,我不想将任何联系人设置为收件人,如何?

java android android-intent

7
推荐指数
1
解决办法
1282
查看次数

Android为什么此按钮不可点击

我不知道为什么最后两个按钮不可单击,我使用了背景(我设置了它们)很多次,并且可以与其他布局一起使用,所以我确定错误是诸如可疑或可单击的,但是我不知道不知道确切在哪里。

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:fillViewport="true" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFFFFF"
            android:orientation="vertical" >

            <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dip"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="10dip"
                android:layout_marginTop="20dip"
                android:layout_weight="1" >

                <Button
                    android:id="@+id/b_orderMeal_selectRestaurant"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_marginRight="30dip"
                    android:text="@string/b_selectRestaurant" />

                <ImageView
                    android:id="@+id/iv_orderMeal_isSelectRestaurant"
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:layout_alignParentRight="true"
                    android:contentDescription="@string/iv_isSelected"
                    android:src="@drawable/x" />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dip"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="10dip"
                android:layout_marginTop="20dip"
                android:layout_weight="1" >

                <Button
                    android:id="@+id/b_orderMeal_selectMealItems"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_marginRight="30dip"
                    android:text="@string/b_select_MealItems" />

                <ImageView
                    android:id="@+id/iv_orderMeal_isSelectMealItems"
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:layout_alignParentRight="true"
                    android:contentDescription="@string/iv_isSelected"
                    android:src="@drawable/x" />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dip"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="10dip" …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-xml android-button

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