some changes

This commit is contained in:
2018-09-13 09:07:29 +02:00
parent 684a548fc0
commit feb4f088d3
17 changed files with 13925 additions and 1322 deletions

View File

@@ -0,0 +1,3 @@
<form action="{{endpoint}}">
<button class="js-submit">Submit</button>
</form>

View File

@@ -0,0 +1,43 @@
import $ from 'jquery';
import Component from '../../../core/Component';
import TextInput from '../TextInput/TextInput';
import Store from '../../../core/store/RestStore';
export default class Form extends Component {
constructor(ctx, node) {
super(ctx, node);
this.store = new Store(this.config.endpoint);
this.render(this.config);
this.fields = [];
let tf1 = new TextInput(ctx);
tf1.config = {
name: 'ssid',
label: 'SSID',
placeholder: 'some AP'
};
tf1.value = 'MyAp';
this.fields.push(tf1);
this.fields.forEach((f) => {
f.render({
name: 'ssid',
label: 'SSID',
placeholder: 'some AP'
});
this.node.prepend(f);
});
this.node.delegate('click', '.js-submit', this.onSubmit.bind(this));
}
onSubmit(evt) {
let obj = {};
obj[this.config.name] = this.value;
//this.store.save(obj);
console.log(this.value);
}
}