EditorGridPanel not using filterArray set from store | Ben Bimber | 2012-01-20 04:57 |
Status: Closed | ||
hi maya, the store you're editing controls which records will be shown in the grid. it sounds like you're referring the to combobox that is used as the editor for the cohort field. the editorgrid will get the metadata for each column in the table (it looks like litterbox.criteria in your case) and then render the appropriate column for this datatype. if the column has a lookup defined, it will create a combobox to use as the editor. this combo is backed by its own store, separate from the one you're manipulating. with our current API, your best option is to check out the columnmodelcustomize event from EditorGridPanel. you'd use something like: var criteriaGrid = new LABKEY.ext.EditorGridPanel({ store: cohortStore, width:800, renderTo: 'criteriaList', autoHeight: true, title: 'Eligibility Criteria', editable: true, showExportButton: false, autoSave: true , listeners: { scope: this, columnmodelcustomize: function(columnModel, index) { //find your column of interest, then look for the editor property. change the store of this editor for one you create. var editor = index[myColumnName].editor; //change the store or replace the whole editor. } }); that code is just typed into the browser and untested, so there might be typos. if you want or need more detail on changing the store for that combo, let me know. another comment: instead of using alert() for debugging, use console.log(). it's less annoying, and you can actually write out objects. |
||