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?