Created
July 11, 2013 18:38
-
-
Save anonymous/5977990 to your computer and use it in GitHub Desktop.
This file contains 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
Ext.define('MyApp.controller.ReportController', { | |
extend: 'Ext.app.Controller', | |
config: { | |
refs: { | |
clientList: 'clientselection list', | |
searchField: 'searchformfield' | |
}, | |
control: { | |
searchField: { | |
keyup: 'onSearchKeyUp', | |
clearicontap: 'onSearchClearIconTap' | |
} | |
} | |
}, | |
filterClients: function (filterText, clientList) { | |
var clientStore = clientList.getStore(); | |
if (filterText) { | |
clientStore.clearFilter(); | |
clientStore.loadPage(1, { | |
params: { | |
filterString: this.getSearchField().getValue() | |
} | |
}); | |
} else { | |
clientStore.clearFilter(); | |
clientStore.loadPage(1, { | |
params: { | |
filterString: '' | |
} | |
}); | |
} | |
clientList.refresh(); | |
}, | |
onSearchClearIconTap: function (searchField, e, eOpts) { | |
this.filterClients(null, this.getClientList()); | |
}, | |
onSearchKeyUp: function (searchField, e, eOpts) { | |
this.filterClients(searchField.getValue(), this.getClientList()); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment