Skip to content

Commit

Permalink
update select value
Browse files Browse the repository at this point in the history
  • Loading branch information
พงศ์ปณต ทัศนียาชุมพาลี authored and พงศ์ปณต ทัศนียาชุมพาลี committed Jul 5, 2018
1 parent 9d85585 commit 3771c9e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
14 changes: 10 additions & 4 deletions aqa-date-picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@
this.child.errorMessage = this.errorMessage
this.child.disabled = this.disabled
this.nativeInput = this.child.$.nativeInput
this.nativeInput.addEventListener('focus', this._showDatePicker.bind(this))

this.child.addEventListener('value-changed', (e)=>this._childValueChanged(e))
this.child.addEventListener('focus', (e)=>this._childValueChanged(e))
this.nativeInput.addEventListener('focus', (e)=>this._showDatePicker(e))



this.aqaDataPickerLight = document.getElementById('aqaDataPickerLight')
this.calendar = aqaDataPickerLight.$.calendar
Expand All @@ -107,7 +112,7 @@
}

_showDatePicker() {
this.child.addEventListener('value-changed', this._childValueChanged.bind(this))
//this._childValueChanged().bind(this)()

this.aqaDataPickerLight.child = this.child

Expand Down Expand Up @@ -136,8 +141,9 @@

}

_childValueChanged(e) {
var value = e.target.value
_childValueChanged() {
console.log('change',this.child.value)
var value = this.child.value
var valueInput = "";

valueInput += value.substring(0, 2)
Expand Down
5 changes: 4 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ <h3>Basic aqa-form demo</h3>
</template>
</dom-bind>

<aqa-date-picker required value="">
<aqa-date-picker required value="[[a]]">
<aqa-input label="วันเกิด"></aqa-input>
</aqa-date-picker>
<aqa-date-picker required value="[[b]]">
<aqa-input label="วันเกิด"></aqa-input>
</aqa-date-picker>
</template>
Expand Down

0 comments on commit 3771c9e

Please sign in to comment.