Last active
April 8, 2016 15:28
-
-
Save rustedgrail/48095edf0f1b4f68a557139496981ea6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SearchForm = Frame.createClass({ | |
render: function() { | |
return ( | |
<input id="search-box" type="text" /> | |
<input id="search-button" type="button" /> | |
) | |
} | |
}); | |
var SearchResults = Frame.createClass({ | |
events: [{ | |
selector: "#input-box", | |
trigger: "change", | |
effect: function(event) { | |
this.setState({searchValue: event.target.value}) | |
} | |
}, { | |
selector: "#input-button", | |
trigger: "click", | |
effect: function() { | |
$.ajax("/model?query=" + event.target.value).then(function(data) { | |
// insert data to search results | |
}) | |
} | |
}], | |
render: function() { | |
return ( | |
// something that holds search results | |
); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment