PDA

View Full Version : Cell Editing plugi: different stores/value sets per row



justinm1
9 Feb 2014, 12:25 PM
I have a grid that shows a series of attributes in the rows, and i want to allow the user to select a new attribute value for each row. Each attribute has a unique set of possible values. I'm using the cell editing plugin with combo boxes to show the attribute values.

The way i'm doing it is to create a new instance of the store, for each row, passing the "extraParams" in to get the values for that particular attribute (it's a remote call).

It looks like the values are populating correctly when i trigger the combo, but as soon as i click another row the value i selected disappears. I'm not sure how to retain that value as i lose focus. Anything obvious i'm missing? Let me know if more info is needed. Here's an image of a portion of the GUI:

47864

I'm using ExtJS 4.1.1. Here's the way the column is defined in the grid:




{
header: 'New Value',
width: 200,
getEditor: function(record){
var attribute = record.get('attrCode');
var store = new app.store.AttributeValuesByTN();
store.getProxy().extraParams = {'attribute' :attribute }

return {
xtype: 'combobox',
typeAhead: false,
dataIndex: 'attrValue',
triggerAction: 'all',
selectOnTab: true,
store: store,
displayField: 'attrValue',
valueField: 'attrValue',
lazyRender: true
}
}


Here's how my store is defined:


Ext.define('app.store.AttributeValuesByTN', {
extend: 'Ext.data.Store',
autoLoad: false,
autoSync: false,
fields: [
{name: 'attrType', type: 'string'},
{name: 'attrKey', type: 'string'},
{name: 'attrValue', type: 'string'}
],
proxy: {
type: 'rest',
format: 'json',
url: '/rest/AttributeListService/valuesbyattribute',
reader: {
type: 'json',
root: 'attributeValues'
}
}
});


Thanks!

Gary Schlosberg
10 Feb 2014, 9:45 AM
Are you able to try your code against version 4.2.1?