New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-tableview-form

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-tableview-form

table view form for react-native

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-tableview-form

React Native Form 支持Android和IOS

image image

Installation

npm i react-native-tableview-form --save
  • 日期选择依赖 react-native-datetime

Usage

First, require it from your app's JavaScript files with:

import Form from 'react-native-tableview-form';

Example

'use strict';

import React,{
    Component,
    StyleSheet,
    View
} from 'react-native';
import Button from 'apsl-react-native-button';
import IconIon from 'react-native-vector-icons/Ionicons';
import Form from 'react-native-tableview-form';

export default class PDF extends Component {
    constructor(props) {
        super(props);
    }
    
    onButtonPress(){
        console.log(this.loginForm.getValue());
    }
    
    render(){
      let model = {
            studentName: {
                type: Form.fieldType.Label,
                label: "姓名",
                value: "Hello Wold!"
            },
            age: {
                type: Form.fieldType.Number,
                label: "年龄",
                value: 18,
                placeholder: "请填写年龄",
                labelStyle: {},
                valueStyle: {},
                onFieldChange: (value, ref)=>{
                    console.log(value);
                    console.log(ref);
                }
            },
            password: {
                type: Form.fieldType.Password,
                label: "密码",
                value: "",
                placeholder: "请填写密码",
                disabled: false,
                labelStyle: {},
                valueStyle: {},
                onFieldChange: (value, ref)=>{
                    console.log(value);
                    console.log(ref);
                }
            },
            selectOne: {
                type: Form.fieldType.Select,
                disabled: false,
                label: "性别",
                value: "男",
                onPress:()=>{
                    console.log('select press.');
                }
            },
            selectDt: {
                type: Form.fieldType.Date,
                disabled: false,
                label: "日期",
                value: "2016-01-03",
                onPress:(date)=>{
                    console.log(date);
                }
            },
            selectTime: {
                type: Form.fieldType.Time,
                disabled: false,
                label: "时间",
                value: "18:43",
                onPress:(time)=>{
                    console.log(time);
                }
            },
            selectDtTime: {
                type: Form.fieldType.DateTime,
                disabled: false,
                label: "日期时间",
                value: "2016-01-03 10:56",
                onPress:(time)=>{
                    console.log(time);
                }
            },
            rememberMe: {
                type: Form.fieldType.Boolean,
                label: "记住我",
                value: true,
                labelStyle: {},
                valueStyle: {},
                onFieldChange: (value, ref)=>{
                    console.log(value);
                    console.log(ref);
                }
            }
        };

        return (
            <View style={{flex:1}}>
                <View style={styles.container}>
                    <View style={styles.qrContainer}>
                        <IconIon
                            name="ios-unlocked-outline"
                            size={120}/>
                    </View>
                    <Form
                        style={{flex:1}}
                        ref={(frm)=> this.loginForm = frm}
                        model={model}
                    />
                    <Button onPress={this.onButtonPress.bind(this)}>
                        确 定
                    </Button>
                </View>
            </View>
        );
    }
}
var styles = StyleSheet.create({
    container: {
        flexDirection: 'column',
        flex: 1,
        margin: 15
    },
    pwdContainer:{
        marginBottom: 20,
        flexDirection:'row',
        alignItems: 'center'
    },
    qrContainer:{
        marginTop: 10,
        marginBottom: 10,
        alignItems: 'center'
    }
});

Methods

  • getValue()

Keywords

FAQs

Package last updated on 21 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc