PDA

View Full Version : Lists with multiSelect and simpleSelect



run4it
14 Nov 2010, 11:29 AM
Has anyone gotten a list to work with multiSelect and simpleSelect? I added multiSelect:true and simpleSelect:true to the list example in the kitchen sink (RC1), but nothing changed.


Ext.setup({
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
icon: 'icon.png',
glossOnIcon: false,
onReady : function() {
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});

var groupingBase = {
multiSelect:true,
simpleSelect:true,
itemTpl: '<div class="contact2"><strong>{firstName}</strong> {lastName}</div>',
grouped: true,
indexBar: true,

disclosure: {
scope: 'test',
handler: function(record, btn, index) {
alert('Disclose more info for ' + record.get('firstName'));
}
},

store: new Ext.data.Store({
model: 'Contact',
sorters: 'firstName',

getGroupString : function(record) {
return record.get('firstName')[0];
},

data: [
{firstName: 'Tommy', lastName: 'Maintz'},
{firstName: 'Ed', lastName: 'Spencer'},
{firstName: 'Jamie', lastName: 'Avins'},
{firstName: 'Aaron', lastName: 'Conran'},
{firstName: 'Dave', lastName: 'Kaneda'},
{firstName: 'Michael', lastName: 'Mullany'},
{firstName: 'Abraham', lastName: 'Elias'},
{firstName: 'Jay', lastName: 'Robinson'},
{firstName: 'Tommy', lastName: 'Maintz'},
]
})
};


if (!Ext.is.Phone) {
new Ext.List(Ext.apply(groupingBase, {
floating: true,
width: 350,
height: 370,
centered: true,
modal: true,
hideOnMaskTap: false
})).show();
}
else {
new Ext.List(Ext.apply(groupingBase, {
fullscreen: true
}));
}
}
});

run4it
15 Nov 2010, 5:46 AM
I just read in another thread that this may not be available in Sencha Touch. True?

Oinary
17 Apr 2011, 3:11 AM
/*
* Tested with ver 3.3.1
*/
var multiSelect = new Ext.ux.form.MultiSelect({
title: 'title',
width: 180,
height: 210,
store: [['1', 'aaa'], ['2', 'bbb'], ['3', 'ccc'], ['4', 'ddd'], ['5', 'eee']],
ddRecorder: true
});

cmp1.add(multiSelect);
cmp1.show

// You can access "view" property ONLY AFTER the MultiSelect component has shown,
// because it is initialized when the component is shown.
multiSelect.view.simpleSelect = true;