How to use the antd-mobile.ListView.DataSource function in antd-mobile

To help you get started, we’ve selected a few antd-mobile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xiyuyizhi / movies / fe / src / component / list.jsx View on Github external
constructor(props) {
        super(props)
        this.props = props
        const ds = new ListView.DataSource({
            rowHasChanged: (r1, r2) => { return r1 !== r2 }
        })
        this._footer = this._footer.bind(this)
        this._row = this._row.bind(this)
        this._onRefresh = this._onRefresh.bind(this)
        this.ds = ds
        this.state = {
            _data: [],
            // refresh: false
        }
    }
github bestRenekton / demos / dva-test / src / routes / IndexPage.js View on Github external
import React from 'react';
import { connect } from 'dva';
import styles from './IndexPage.less';
import { NavBar, Icon, SearchBar, Tabs, WhiteSpace, Badge, List, ListView } from 'antd-mobile';

const tabs = [
  { title: First Tab },
  { title: Second Tab },
];
const Item = List.Item;
const Brief = Item.Brief;
const DS = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 });
const dataSource = DS.cloneWithRows([1111, 222, 3333, 4444, 55555, 6, 7, 8, 9, 90, 100, 234])


function IndexPage() {
  return (
    <div>
      <div>
        } mode="dark"&gt;微信浏览器禁止页面下拉查看网址
      </div>
      <div>
        <div>
          
          <div style="{{" id="LIST">
             { console.log('onChange', index, tab); }}</div></div></div></div>
github smalltide / react-native-dva-antd-manager / src / routes / EmployeeList.js View on Github external
createDataSource({ employees }) {
    const ds = new ListView.DataSource({
      rowHasChanged: (r1, r2) => r1 !== r2
    });

    this.dataSource = ds.cloneWithRows(employees);
  }
github ivan-My / live / src / containers / Works / Lists / index.jsx View on Github external
formatDataSource() {
    const data = new ListView.DataSource({
      rowHasChanged: (row1, row2) => row1 !== row2
    });
    return data.cloneWithRows(this.props.data);
  }
github yeojongki / douban-house / src / components / House / List.jsx View on Github external
import React from 'react';
import { PullToRefresh, ListView, ActivityIndicator } from 'antd-mobile';
import HouseItem from './Item';
import Empty from '../Empty';

const NoMoreText = '没有更多了哦~';
const ds = new ListView.DataSource({
  rowHasChanged: (r1, r2) =&gt; r1 !== r2
});
const row = rowData =&gt; ;

const EmptyHandle = list =&gt;
  list &amp;&amp; list.length === 0 ? (
    
  ) : null;

export default props =&gt; {
  const { list, height } = props;
  return list &amp;&amp; list.length ? (
    <div>
      </div>
github zxj963577494 / OverWatchTeams / src / components / AccountResumeOrderListView / index.js View on Github external
render() {
    const dataSource = new ListView.DataSource({
      rowHasChanged: (row1, row2) =&gt; row1 !== row2
    }).cloneWithRows(this.props.resumeOrder.list)
    const separator = (sectionID, rowID) =&gt; 
    const row = (rowData, sectionID, rowID) =&gt; {
      return (
        <div>
          
            
                  <button> {
                      this.props.navigateTo(
                        '/account/resumeorders/edit/' + rowData.objectId</button></div>
github zxj963577494 / OverWatchTeams / src / components / AccountRecruitOrderListView / index.js View on Github external
render() {
    const dataSource = new ListView.DataSource({
      rowHasChanged: (row1, row2) =&gt; row1 !== row2
    }).cloneWithRows(this.props.recruitOrder.list)
    const separator = (sectionID, rowID) =&gt; 
    const row = (rowData, sectionID, rowID) =&gt; {
      return (
        <div>
          
            
                  <button> {
                      this.props.navigateTo(
                        '/account/recruitorders/edit/' + rowData.objectId</button></div>
github jgchenu / Mobile-electricity-provider3 / src / pages / CategoryList / index.jsx View on Github external
constructor() {
    super();
    const dataSource = new ListView.DataSource({
      rowHasChanged: (row1, row2) => row1 !== row2
    });
    this.state = {
      pageSize: 10,
      category: [],
      categoryIndex: 0,
      categorySub: [],
      active: 0,
      loading: false,
      finished: false,
      isRefresh: false,
      page: 1,
      goodList: [],
      categorySubId: "",
      errorImg:
        'this.src="' + require("../../resource/images/errorImg.jpg") + '"',
github Juliiii / React-Cnode / src / components / List / index.js View on Github external
componentWillReceiveProps (newProps) {
    let dataSource = new ListView.DataSource({
      rowHasChanged: (r1, r2) => r1 !== r2
    });
    this.setState({
      dataSource: dataSource.cloneWithRows(newProps.data.slice())
    });
  }