Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    filterOnKeyPress when editing

    I would like to suppress filtering on every key press in an editable ListGrid field defined as follows:

    Code:
    var myGrid = isc.ListGrid.create({
                                          dataSource: "DiseaseMarkerTrialDS",
        			width: 200,
        			height: 100,
        			showFilterEditor: false,
        			fields: [{name: "trial", width: "*",
        					filterOnKeypress: false,
        					editorProperties: {
        						cachePickListResults: false,
    			    			optionDataSource: "ClinicalTrialDS",
    							optionFilterContext: {sortBy: "name", textMatchStyle: "startsWith"},
    							valueField: "id",
    							displayField: "name"
        						}
        					}
        			]
    ...
    My intention is to force a database fetch on the ClinicalTrial table whenever the user edits the 'trial' field, since the ClinicalTrial table is constantly being updated through various users.
    Since the names of clinical trials all start with 'NCT' I also want to prevent filtering on the 'trial' field until the entire NCTID number has been entered by the user. This type of behavior seems to work fine in the filterEditor but not when editing a field in the ListGrid.

    I am having two issues;
    1) The ClinicalTrialDS optionDataSource seems to be maintaining its cache even though I use cachePickListResults: false
    2) The dataset is being fetched (in the editor) on every keystroke. I know that filterOnKeypress typically applies to filtering in the filterEditor, but I am filtering in an editable field in the ListGrid.

    Any help would be appreciated.
    Thanks
    pf

    #2
    1) You want to set ResultSet.useClientFiltering:false via pickListProperties.dataProperties. cachePickListResults controls a different level of caching.

    2) move changeOnKeypress:false in the editorProperties block will suppress filtering until you trigger it manually (or the user leaves the field). Is that what you want?

    Comment

    Working...
    X