constructor(props) { super(props); let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); this.state = { url: props.url, dataSource: ds.cloneWithRows([]) } }
//页面渲染完成请求数据 componentDidMount() { let url = this.state.url; let that = this; Uitls.ajax(url, function (data) { if (data.status === 1) { let obj = data.data; let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); that.setState({ dataSource: ds.cloneWithRows(obj) }) } else { alert('服务异常,正在紧急修复,请耐心等待'); } }, function (err) { alert('服务异常,正在紧急修复,请耐心等待'); }) }
constructor(props) { super(props); const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); this.state = { dataSource: ds.cloneWithRows(routes), }; this.renderRow = this.renderRow.bind(this); }
constructor () { super(); this.ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => { return r1.key !== r2.key; } }); }
constructor(props) { super(props); this.state = { dataSource: new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }), loaded: false, }; this.fetchData = this.fetchData.bind(this); }
constructor(props) { super(props); let ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2, sectionHeaderHasChanged: (s1, s2) => s1 !== s2 }); let data = [vegetables, fruits, [others]]; this.state = { dataSource: ds.cloneWithRowsAndSections(data) } }
constructor(props) { super(props); let ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); this.state = { dataSource: ds.cloneWithRows(data) } }
constructor(props) { super(props); this.state = { editProfilesInProgress: false }; this.profiles = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); }
constructor(props) { super(props); let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); this.state = { url: props.url, dataSource: ds.cloneWithRows([]) } }
//页面渲染完成请求数据 componentDidMount() { let url = this.state.url; let that = this; Uitls.ajax(url, function (data) { if (data.status === 1) { let obj = data.data; let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); that.setState({ dataSource: ds.cloneWithRows(obj) }) } else { alert('服务异常,正在紧急修复,请耐心等待'); } }, function (err) { alert('服务异常,正在紧急修复,请耐心等待'); }) }
constructor(props) { super(props); let ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2, sectionHeaderHasChanged: (s1, s2) => s1 !== s2 }); let data = [vegetables, fruits, [others]]; this.state = { dataSource: ds.cloneWithRowsAndSections(data) } }
constructor(props) { super(props); let ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); this.state = { dataSource: ds.cloneWithRows(items) } }
constructor(props) { super(props); let ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); this.state = { dataSource: ds.cloneWithRows(data) } }
constructor(props) { super(props); var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); this.state = { dataSource: ds.cloneWithRows([]) }; }
constructor(props) { super(props) const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2}) const { list } = props this.state = { list: ds.cloneWithRows(list) } }