PDA

View Full Version : content of gridpanel can't select



kyousuke
1 Sep 2011, 8:03 PM
I can't select and copy the content of the gridpanel.

raz0r1
1 Sep 2011, 9:10 PM
this is no question...post more

kyousuke
1 Sep 2011, 9:47 PM
this is no question...post more
Please run the example and select the content. It can't select.



Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone'],
data:{'items':[
{"name":"Lisa", "email":"lisa@simpsons.com", "phone":"555-111-1224"},
{"name":"Bart", "email":"bart@simpsons.com", "phone":"555--222-1234"},
{"name":"Homer", "email":"home@simpsons.com", "phone":"555-222-1244"},
{"name":"Marge", "email":"marge@simpsons.com", "phone":"555-222-1254"}
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});

Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{header: 'Name', dataIndex: 'name'},
{header: 'Email', dataIndex: 'email', flex:1},
{header: 'Phone', dataIndex: 'phone'}
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});

kyousuke
1 Sep 2011, 9:50 PM
I think the cause is the div has an "unselectable" attribute that value is "on".

raz0r1
1 Sep 2011, 9:56 PM
You have To add a selection Model like rowselectionmodel.

SRY im from mobile Dev so i cant Post examples.

kyousuke
2 Sep 2011, 1:15 AM
You have To add a selection Model like rowselectionmodel.

SRY im from mobile Dev so i cant Post examples.
Sorry, I can't find any attribute in Ext.grid.Panel like selection model, row model.
Could you tell me which attribute that can make me select the content.

raz0r1
2 Sep 2011, 1:29 AM
The config is "selModel". You have To Paste an object with "Type: 'rowselection'" i think. Or similar To that. This should be described in The doc of selmodel config Option.

daiei27
2 Sep 2011, 6:18 AM
I was under the impression selection model only referred to what was selected when you clicked on a grid: the row you're on or the cell you're on. Either way, it does not let you simply highlight so you can copy/paste as kyousuke said.

Now there may be a way to create a listener that can go into the selection model and grab the selected records, but it appears this behavior most people are used to does not come by default.

daiei27
2 Sep 2011, 6:29 AM
http://www.sencha.com/forum/showthread.php?22218-Text-Selections-in-Grid-cell&p=205984&viewfull=1#post205984

This is what I used in ExtJS 3.x and it worked. Haven't tried it in 4.x yet...

daiei27
2 Sep 2011, 7:04 AM
If you're reading this, show your support in this 4.x thread:
http://www.sencha.com/forum/showthread.php?124562-Devs-please-give-option-to-select-text-in-a-grid

kyousuke
2 Sep 2011, 8:01 PM
http://www.sencha.com/forum/showthread.php?22218-Text-Selections-in-Grid-cell&p=205984&viewfull=1#post205984

This is what I used in ExtJS 3.x and it worked. Haven't tried it in 4.x yet...

It can worked in 3 but not 4.
Waiting for the next release. I hope the next can do it with a config option.