PDA

View Full Version : Output matching records when entering (in a grid type)



neosky
28 May 2014, 5:06 AM
Hello i am have form with input field,when i am enter text then output drop-down list (in a table) with matching records (as a filter on the field 'Book'). But now when i am enter text then output table with all records in field 'Book', i am want only matching records


{
xtype: 'gridpicker',
store:'Book',
beforeQuery: function(query) {
query.combo.getGrid().getSelectionModel().deselectAll();
query.combo.store.load();
return query;
},
gridConfig: {
columns: [
{header: 'id', dataIndex: 'id', flex: 1, hidden: true},
{header: 'Book', dataIndex: 'Book', flex: 1, hidden: false},
{header: 'Author.', dataIndex: 'Author', width: 40, hidden: false},
{header: 'Price', dataIndex: 'Price', width: 30, hidden: false},
],
hideHeaders: false,
ignoreSelection: false
},
typeAhead: false,
hideTrigger: true,
fieldLabel: 'Book',
displayField: 'Book',
valueField: 'id',
forceSelection: true,
width: 400 },

scottmartin
28 May 2014, 8:27 AM
We have the following examples:

http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/form/forum-search.html
http://docs.sencha.com/extjs/4.2.1/extjs-build/examples/grid/live-search-grid.html

The basic idea is to issue a search that makes an ajax call to the server and returns the matching data to the store that is assigned to the grif that will display the data.