Skip to content

Commit

Permalink
Fixed a Search Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo Perez Perez committed Apr 11, 2015
1 parent aae4daa commit 29bf3f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion addon/components/crud-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ export default Ember.Component.extend({

},
toTSV: function () {

var data = [];
var row = [];
this.labels.forEach(function (field) {
Expand Down Expand Up @@ -245,6 +244,13 @@ export default Ember.Component.extend({
},
internal_search: function () {
var field = $("#SearchField").val();
var that = this;

Object.keys(that.fields).forEach(function(fieldname){
if(that.fields[fieldname].Label == field){
field = fieldname;
}
});
var query = {};
var that = this;
query[field] = this.get('SearchTerm');
Expand Down
3 changes: 2 additions & 1 deletion addon/templates/components/crud-table.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
<tr>
{{#each field in this.labels}}
<th>{{field}}</th>
{{/each}} {{#if this.editdelete}}
{{/each}}
{{#if this.editdelete}}
<th width="100px">Actions</th>
{{/if}}
</tr>
Expand Down

0 comments on commit 29bf3f5

Please sign in to comment.