0

I want my Extjs data view to always select at least one record. According to the document I can use mode: 'SINGLE' with allowDeselect: false to achieve this result.

                    {
                        itemId: 'data-view',
                        xtype: 'dataview',
                        trackOver: true,
                        overItemCls: 'data-over',
                        selectedItemCls: 'data-selected',
                        mode: 'SINGLE',
                        allowDeselect: false,
                        selModel: {
                            mode: 'SINGLE',
                            allowDeselect: false
                        },
                        itemSelector: me.selector, 
                        tpl: me.tpl
                    },

I put mode and allowDeselect in two places as you can see, but it won't work.

That is, I can still click on any blank space in the data view, and the Selected item will be Deselected.

Can you tell me how to force allowDeselect to be false properly?

Tom
  • 15,781
  • 14
  • 69
  • 111
  • check out this question:http://stackoverflow.com/questions/9141918/extjs-dataview-itemselector-pointing-to-child-element – Dev Jun 20 '14 at 08:58

1 Answers1

1

It must be a bug. As a workaround install this listener:

listeners:{
    beforecontainerclick:function() {
        return false;
    }
}
Saki
  • 5,827
  • 2
  • 15
  • 15