今天,我有一个$( "#your_form_id" ).submit(function(event) {
event.preventDefault();
$.ajax({
beforeSend: function () {
//something to do before ajax call
},
complete: function () {
//something to do after ajax call
},
type:"POST",
data:$(this).serialize(),
url:"<?php echo $url;?>",
success:function(data){
$('#divId').html(data); // id where you want to retrive and show your data
}
});
});
,它显示了固定的信息,我需要对其进行更改,以便用户可以选择要显示的信息。
我的问题是我不知道如何复制下面图像的行为。你们能帮我安排一下吗?配置字段的所有部分均已完成。
图像中的每个示例都是RecyclerView
(文件RecyclerView
)的一行。
谢谢
activity_asset_list.xml:
asset_list_item.xml
asset_list_item.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="br.com.company.project.AssetListActivity"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar">
<android.support.v7.widget.RecyclerView
android:id="@+id/main_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:paddingBottom="@dimen/activity_margin_content"
android:paddingTop="0dp"
android:scrollbars="vertical"/>
</android.support.v4.widget.SwipeRefreshLayout>
<ProgressBar
style="@style/Widget.AppCompat.ProgressBar"
android:theme="@style/CircularProgress"
android:id="@+id/main_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_centerInParent="true"/>
</RelativeLayout>