mercredi 21 mai 2014

Grid panel and combobox issue

I'm having issues getting my store on the grid panel to update and render properly from the combobox input. what I mean by this is, when I type into the combobox field, I want it to use the "typeAhead" property and list the selected "displayfield" item, and display the row on the gird panel. Here's my code:

combobox


Code:



var comboBox = Ext.create('Ext.toolbar.Toolbar',{ items:[{
store: store,
xtype:'combo',
width:350,
fieldLabel:'Search Title',
displayField:'title',
queryMode: 'local',
buffer:140,
enableKeyEvents: true,
typeAhead:true,
hideTrigger:true


}],
renderTo:Ext.getBody()

});

Grid Panel


Code:



var grid = Ext.create('Ext.grid.Panel', {
store: store,
scrollable:true,
autoShow: true,
columns: [
{text: "Title", width: 250, dataIndex: 'title', sortable: true},
{text: "description", width: 500, dataIndex: 'description', sortable: true},
{text: "Link", width: 350, dataIndex: 'link', sortable: true}
],
renderTo:Ext.getBody(),
width: '100%',
height: 350
});

Store


Code:



var store = Ext.create('Ext.data.Store', {
model: 'RssFeedModel',
autoLoad: true,
proxy: {
// load using HTTP
type: 'ajax',
url: 'xmlCFFEED.cfm',

// the return will be XML, so lets set up a reader
reader:{
type: 'xml',
// records will have an "Item"
record: 'item',
rootProperty: "channel",
descriptionProperty:"description",
lastbuilddateProperty: "lastbuilddate"
}
}
});




Aucun commentaire:

Enregistrer un commentaire