View Full Version : Dataview & CheckboxSelectionModel

12 Sep 2008, 5:27 PM

I need to use CheckBoxSelection model with a Dataview. I have the dataview in place but am not sure how do I use the CheckBoxSelection in conjuction with a dataview.

I have tried a way suggested by one of the members here as below. But didn't work for me.

You can use Ext.grid.CheckboxSelectionModel as a grid selection model and
set Ext.DataView simpleSelect option to true.

This is how my code currently looks like...

var tpl = new Ext.XTemplate(
'<tpl for=".">',
'<div class="{[xindex % 2 === 0 ? "even" : "odd"]}" style="padding-top:10px; padding-bottom:10px;">',
'<table id="thumbTbl_{entry_id}" cellspacing="0" cellpadding="0" border="0" width="100%">',
'<tr><td>Name: {f_name}</td></tr>',
'<div class="x-clear"></div>'

var smThumbs = new Ext.grid.CheckboxSelectionModel();

var thumbViewGrid = new Ext.Panel({
title:'Thumbnail View',
frame: false,
items: new Ext.DataView({
store: folderStore,
tpl: tpl,
multiSelect: true,
simpleSelect: true,
emptyText: 'No results to display',
loadingText: 'Loading contents...'
viewConfig: {
forceFit: true,
scrollOffset: 1
renderTo: 'thumbViewGrid'

I am getting wierd error messages here. like the following:
ERROR: ss.replace is not a function
ERROR: path.split is not a function

I have spent almost half a day now to get this workin. But am not still clear about the correct way of going about it. Please help.


13 Sep 2008, 9:10 AM
Sumone please help... I am in need of a solution for this... I have tried even creating a checkbox manually in the template and then assigning it to the itemSelector.
But when you click on the checkbox, it checks and unchecks almost instantaneously.

Your help will be highly appreciated.